Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
packer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
packer
Commits
8c9d2454
Commit
8c9d2454
authored
Oct 16, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
command/build: remove asserts framewor
parent
79f7936d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
12 deletions
+11
-12
command/build/command_test.go
command/build/command_test.go
+10
-11
packer/config_template.go
packer/config_template.go
+1
-1
No files found.
command/build/command_test.go
View file @
8c9d2454
...
...
@@ -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
)
}
}
packer/config_template.go
View file @
8c9d2454
...
...
@@ -93,5 +93,5 @@ func templateTimestamp() string {
}
func
templateUuid
()
string
{
return
hex
.
EncodeToString
(
uuid
.
TimeOrderedUUID
()
)
return
uuid
.
TimeOrderedUUID
(
)
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment