Move Vagrant::Machine monkey patch out to a spec support file
This commit is contained in:
parent
3909a26ea3
commit
8c8c11f07c
2 changed files with 13 additions and 14 deletions
|
@ -1,19 +1,5 @@
|
||||||
require 'acceptance_helper'
|
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
|
describe 'Sanity check' do
|
||||||
after(:all) { destroy_container }
|
after(:all) { destroy_container }
|
||||||
|
|
||||||
|
|
13
spec/acceptance/support/machine_ext.rb
Normal file
13
spec/acceptance/support/machine_ext.rb
Normal file
|
@ -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
|
Loading…
Reference in a new issue