From ae6f00d76660c48b3efabe4a1321fc7f740b9122 Mon Sep 17 00:00:00 2001 From: Matt Bell Date: Wed, 19 Nov 2014 00:36:42 -0800 Subject: [PATCH] commands: Fixed tests --- commands/cli/parse_test.go | 2 +- commands/command_test.go | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/commands/cli/parse_test.go b/commands/cli/parse_test.go index cddd54669..8fe5b3510 100644 --- a/commands/cli/parse_test.go +++ b/commands/cli/parse_test.go @@ -11,7 +11,7 @@ func TestOptionParsing(t *testing.T) { subCmd := &commands.Command{} cmd := &commands.Command{ Options: []commands.Option{ - commands.Option{Names: []string{"b"}, Type: commands.String}, + commands.StringOption("b", "some option"), }, Subcommands: map[string]*commands.Command{ "test": subCmd, diff --git a/commands/command_test.go b/commands/command_test.go index ab090fe2c..4fcc48bd8 100644 --- a/commands/command_test.go +++ b/commands/command_test.go @@ -9,8 +9,8 @@ func noop(req Request) (interface{}, error) { func TestOptionValidation(t *testing.T) { cmd := Command{ Options: []Option{ - Option{[]string{"b", "beep"}, Int, "enables beeper"}, - Option{[]string{"B", "boop"}, String, "password for booper"}, + IntOption("b", "beep", "enables beeper"), + StringOption("B", "boop", "password for booper"), }, Run: noop, } @@ -93,14 +93,14 @@ func TestOptionValidation(t *testing.T) { func TestRegistration(t *testing.T) { cmdA := &Command{ Options: []Option{ - Option{[]string{"beep"}, Int, "number of beeps"}, + IntOption("beep", "number of beeps"), }, Run: noop, } cmdB := &Command{ Options: []Option{ - Option{[]string{"beep"}, Int, "number of beeps"}, + IntOption("beep", "number of beeps"), }, Run: noop, Subcommands: map[string]*Command{ @@ -110,7 +110,7 @@ func TestRegistration(t *testing.T) { cmdC := &Command{ Options: []Option{ - Option{[]string{"encoding"}, String, "data encoding type"}, + StringOption("encoding", "data encoding type"), }, Run: noop, }