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
05e254a2
Commit
05e254a2
authored
Apr 20, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BuilderFactory getter on Environment
parent
298c0ffa
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
packer/environment.go
packer/environment.go
+5
-0
packer/environment_test.go
packer/environment_test.go
+9
-0
No files found.
packer/environment.go
View file @
05e254a2
...
...
@@ -80,6 +80,11 @@ func NewEnvironment(config *EnvironmentConfig) (env *Environment, err error) {
return
}
// Returns the BuilderFactory associated with this Environment.
func
(
e
*
Environment
)
BuilderFactory
()
BuilderFactory
{
return
e
.
builderFactory
}
// Executes a command as if it was typed on the command-line interface.
// The return value is the exit code of the command.
func
(
e
*
Environment
)
Cli
(
args
[]
string
)
int
{
...
...
packer/environment_test.go
View file @
05e254a2
...
...
@@ -60,6 +60,15 @@ func TestNewEnvironment_NoConfig(t *testing.T) {
assert
.
NotNil
(
err
,
"should be an error"
)
}
func
TestEnvironment_GetBuilderFactory
(
t
*
testing
.
T
)
{
assert
:=
asserts
.
NewTestingAsserts
(
t
,
true
)
config
:=
DefaultEnvironmentConfig
()
env
,
_
:=
NewEnvironment
(
config
)
assert
.
Equal
(
env
.
BuilderFactory
(),
config
.
BuilderFactory
,
"should match factories"
)
}
func
TestEnvironment_Cli_CallsRun
(
t
*
testing
.
T
)
{
assert
:=
asserts
.
NewTestingAsserts
(
t
,
true
)
...
...
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