From ac64805a9eddff2caa28fe6a213510e0fc3efd1e Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 16 Oct 2013 16:27:15 -1000 Subject: [PATCH] command/build: remove asserts framewor --- command/build/command_test.go | 21 ++++++++++----------- packer/config_template.go | 2 +- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/command/build/command_test.go b/command/build/command_test.go index 33559cfc5..2edd82b4a 100644 --- a/command/build/command_test.go +++ b/command/build/command_test.go @@ -2,7 +2,6 @@ package build import ( "bytes" - "cgl.tideland.biz/asserts" "github.com/mitchellh/packer/packer" "testing" ) @@ -23,33 +22,33 @@ func testEnvironment() packer.Environment { } func TestCommand_Implements(t *testing.T) { - assert := asserts.NewTestingAsserts(t, true) - - var actual packer.Command - assert.Implementor(new(Command), &actual, "should be a Command") + var _ packer.Command = new(Command) } func TestCommand_Run_NoArgs(t *testing.T) { - assert := asserts.NewTestingAsserts(t, true) command := new(Command) result := command.Run(testEnvironment(), make([]string, 0)) - assert.Equal(result, 1, "no args should error") + if result != 1 { + t.Fatalf("bad: %d", result) + } } func TestCommand_Run_MoreThanOneArg(t *testing.T) { - assert := asserts.NewTestingAsserts(t, true) command := new(Command) args := []string{"one", "two"} result := command.Run(testEnvironment(), args) - assert.Equal(result, 1, "More than one arg should fail") + if result != 1 { + t.Fatalf("bad: %d", result) + } } func TestCommand_Run_MissingFile(t *testing.T) { - assert := asserts.NewTestingAsserts(t, true) command := new(Command) args := []string{"i-better-not-exist"} result := command.Run(testEnvironment(), args) - assert.Equal(result, 1, "a non-existent file should error") + if result != 1 { + t.Fatalf("bad: %d", result) + } } diff --git a/packer/config_template.go b/packer/config_template.go index 4be4d1c94..98dde878d 100644 --- a/packer/config_template.go +++ b/packer/config_template.go @@ -93,5 +93,5 @@ func templateTimestamp() string { } func templateUuid() string { - return hex.EncodeToString(uuid.TimeOrderedUUID()) + return uuid.TimeOrderedUUID() }