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
28a13111
Commit
28a13111
authored
Jul 13, 2015
by
Chris Bednarski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add stub for validate test
parent
d2339b7c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
0 deletions
+42
-0
command/test-fixtures/validate/template.json
command/test-fixtures/validate/template.json
+10
-0
command/validate_test.go
command/validate_test.go
+32
-0
No files found.
command/test-fixtures/validate/template.json
0 → 100644
View file @
28a13111
{
"builders"
:[
{
"type"
:
"file"
,
"target"
:
"chocolate.txt"
,
"content"
:
"chocolate"
}
],
"min_packer_version"
:
"0.8.0"
}
command/validate_test.go
0 → 100644
View file @
28a13111
package
command
import
(
"path/filepath"
"testing"
)
func
TestValidateCommand
(
t
*
testing
.
T
)
{
c
:=
&
ValidateCommand
{
Meta
:
testMetaFile
(
t
),
}
args
:=
[]
string
{
filepath
.
Join
(
testFixture
(
"validate"
),
"template.json"
),
}
defer
cleanup
()
if
code
:=
c
.
Run
(
args
);
code
!=
0
{
fatalCommand
(
t
,
c
.
Meta
)
}
if
!
fileExists
(
"chocolate.txt"
)
{
t
.
Error
(
"Expected to find chocolate.txt"
)
}
if
!
fileExists
(
"vanilla.txt"
)
{
t
.
Error
(
"Expected to find vanilla.txt"
)
}
if
fileExists
(
"cherry.txt"
)
{
t
.
Error
(
"Expected NOT to find cherry.txt"
)
}
}
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