diff --git a/spec/acceptance/sanity_check_spec.rb b/spec/acceptance/sanity_check_spec.rb index 6c891fe..782e6aa 100644 --- a/spec/acceptance/sanity_check_spec.rb +++ b/spec/acceptance/sanity_check_spec.rb @@ -1,19 +1,5 @@ require 'acceptance_helper' -# Monkey patch vagrant in order to reuse the UI test object that is set on -# our Vagrant::Environments -# -# TODO: Find out if this makes sense to be on vagrant core itself -require 'vagrant/machine' -Vagrant::Machine.class_eval do - alias :old_action :action - - define_method :action do |name, extra_env = nil| - extra_env = { ui: @env.ui }.merge(extra_env || {}) - old_action name, extra_env - end -end - describe 'Sanity check' do after(:all) { destroy_container } diff --git a/spec/acceptance/support/machine_ext.rb b/spec/acceptance/support/machine_ext.rb new file mode 100644 index 0000000..d09fcff --- /dev/null +++ b/spec/acceptance/support/machine_ext.rb @@ -0,0 +1,13 @@ +# Monkey patch vagrant in order to reuse the UI test object that is set on +# our Vagrant::Environments +# +# TODO: Find out if this makes sense to be on vagrant core itself +require 'vagrant/machine' +Vagrant::Machine.class_eval do + alias :old_action :action + + define_method :action do |name, extra_env = nil| + extra_env = { ui: @env.ui }.merge(extra_env || {}) + old_action name, extra_env + end +end