Commit 05e254a2 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

BuilderFactory getter on Environment

parent 298c0ffa
......@@ -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 {
......
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment