Skip to content
This repository has been archived by the owner on Apr 27, 2022. It is now read-only.

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin committed May 24, 2016
1 parent 5e308a8 commit 8edda5e
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions staert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1069,6 +1069,10 @@ func TestRunFleagFieldUnderPtrUnderPtr1Command(t *testing.T) {
s := NewStaert(rootCmd)
fs := flaeg.New(rootCmd, args)
s.AddSource(fs)
_, err := s.GetConfig()
if err != nil {
t.Fatalf("Error %s", err.Error())
}
if err := s.Run(); err != nil {
t.Fatalf("Error %s", err.Error())
}
Expand Down Expand Up @@ -1165,6 +1169,10 @@ func TestRunFleagFieldUnderPtrUnderPtr2Command(t *testing.T) {
fs.AddCommand(versionCmd)
s.AddSource(fs)
//check in command run func
_, err := s.GetConfig()
if err != nil {
t.Fatalf("Error %s", err.Error())
}
if err := s.Run(); err != nil {
t.Fatalf("Error %s", err.Error())
}
Expand Down Expand Up @@ -1259,6 +1267,10 @@ func TestRunFleagVersion2CommandCallVersion(t *testing.T) {
fs.AddCommand(versionCmd)
s.AddSource(fs)
//check in command run func
_, err := s.GetConfig()
if err != nil {
t.Fatalf("Error %s", err.Error())
}
if err := s.Run(); err != nil {
t.Fatalf("Error %s", err.Error())
}
Expand Down Expand Up @@ -1357,6 +1369,10 @@ func TestRunMergeFlaegToml2CommmandCallRootCmd(t *testing.T) {
toml := NewTomlSource("trivial", []string{"./toml/", "/any/other/path"})
s.AddSource(toml)
//check in command run func
_, err := s.GetConfig()
if err != nil {
t.Fatalf("Error %s", err.Error())
}
if err := s.Run(); err != nil {
t.Fatalf("Error %s", err.Error())
}
Expand Down Expand Up @@ -1492,6 +1508,10 @@ func TestTomlMissingCustomParser(t *testing.T) {
s := NewStaert(command)
toml := NewTomlSource("missingCustomParser", []string{"toml"})
s.AddSource(toml)
_, err := s.GetConfig()
if err != nil {
t.Fatalf("Error %s", err.Error())
}
if err := s.Run(); err != nil {
t.Fatalf("Error :%s", err)
}
Expand Down

0 comments on commit 8edda5e

Please sign in to comment.