refactoring input and configuration

This commit is contained in:
Brad Rydzewski
2016-04-29 12:39:56 -07:00
parent 4d4003a9a1
commit 082570fb5b
34 changed files with 1784 additions and 1345 deletions

View File

@@ -46,31 +46,32 @@ func TestHook(t *testing.T) {
})
}
func TestLoad(t *testing.T) {
conf := "https://github.com?client_id=client&client_secret=secret&scope=scope1,scope2"
g := Load(conf)
if g.URL != "https://github.com" {
t.Errorf("g.URL = %q; want https://github.com", g.URL)
}
if g.Client != "client" {
t.Errorf("g.Client = %q; want client", g.Client)
}
if g.Secret != "secret" {
t.Errorf("g.Secret = %q; want secret", g.Secret)
}
if g.Scope != "scope1,scope2" {
t.Errorf("g.Scope = %q; want scope1,scope2", g.Scope)
}
if g.API != DefaultAPI {
t.Errorf("g.API = %q; want %q", g.API, DefaultAPI)
}
if g.MergeRef != DefaultMergeRef {
t.Errorf("g.MergeRef = %q; want %q", g.MergeRef, DefaultMergeRef)
}
g = Load("")
if g.Scope != DefaultScope {
t.Errorf("g.Scope = %q; want %q", g.Scope, DefaultScope)
}
}
//
// func TestLoad(t *testing.T) {
// conf := "https://github.com?client_id=client&client_secret=secret&scope=scope1,scope2"
//
// g := Load(conf)
// if g.URL != "https://github.com" {
// t.Errorf("g.URL = %q; want https://github.com", g.URL)
// }
// if g.Client != "client" {
// t.Errorf("g.Client = %q; want client", g.Client)
// }
// if g.Secret != "secret" {
// t.Errorf("g.Secret = %q; want secret", g.Secret)
// }
// if g.Scope != "scope1,scope2" {
// t.Errorf("g.Scope = %q; want scope1,scope2", g.Scope)
// }
// if g.API != DefaultAPI {
// t.Errorf("g.API = %q; want %q", g.API, DefaultAPI)
// }
// if g.MergeRef != DefaultMergeRef {
// t.Errorf("g.MergeRef = %q; want %q", g.MergeRef, DefaultMergeRef)
// }
//
// g = Load("")
// if g.Scope != DefaultScope {
// t.Errorf("g.Scope = %q; want %q", g.Scope, DefaultScope)
// }
// }