BuilderFactory getter on Environment
This commit is contained in:
parent
298c0ffa17
commit
05e254a2ff
|
@ -80,6 +80,11 @@ func NewEnvironment(config *EnvironmentConfig) (env *Environment, err error) {
|
||||||
return
|
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.
|
// Executes a command as if it was typed on the command-line interface.
|
||||||
// The return value is the exit code of the command.
|
// The return value is the exit code of the command.
|
||||||
func (e *Environment) Cli(args []string) int {
|
func (e *Environment) Cli(args []string) int {
|
||||||
|
|
|
@ -60,6 +60,15 @@ func TestNewEnvironment_NoConfig(t *testing.T) {
|
||||||
assert.NotNil(err, "should be an error")
|
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) {
|
func TestEnvironment_Cli_CallsRun(t *testing.T) {
|
||||||
assert := asserts.NewTestingAsserts(t, true)
|
assert := asserts.NewTestingAsserts(t, true)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue