Skip to content

Commit

Permalink
Fixing cli sub-package tests. The cxt.Get tests need to have a defaul…
Browse files Browse the repository at this point in the history
…t value as a second argument.
  • Loading branch information
mattfarina committed Oct 16, 2013
1 parent 0fe08ed commit 635cabb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cli/commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func TestShowHelp(t *testing.T) {
t.Error("! Unexpected error.")
}

res := context.Get("didShowHelp").(bool)
res := context.Get("didShowHelp", false).(bool)

if !res {
t.Error("! Expected help to be shown.")
Expand Down Expand Up @@ -64,7 +64,7 @@ func TestParseArgs(t *testing.T) {
return
}

foo := cxt.Get("foo").(string)
foo := cxt.Get("foo", "").(string)
if foo != "bar" {
t.Error("Expected 'bar'; got ", foo)
return
Expand All @@ -82,7 +82,7 @@ func TestParseArgs(t *testing.T) {
return
}

unused := cxt.Get("unused").(string)
unused := cxt.Get("unused", 321).(string)
if unused != "123" {
t.Error("Expected 'unused' to be int 123. Got ", unused)
return
Expand Down

0 comments on commit 635cabb

Please sign in to comment.