Test to ensure that the environment hash is returned from Machine#action
This will allow methods that call into the action to use any results that might be set onto the environment hash by any of the middleware.
This commit is contained in:
parent
5e70ad0ec2
commit
de0865b9e2
|
@ -160,6 +160,16 @@ describe Vagrant::Machine do
|
|||
foo.should == :bar
|
||||
end
|
||||
|
||||
it "should return the environment as a result" do
|
||||
action_name = :up
|
||||
callable = lambda { |env| env[:result] = "FOO" }
|
||||
|
||||
provider.stub(:action).with(action_name).and_return(callable)
|
||||
result = instance.action(action_name)
|
||||
|
||||
result[:result].should == "FOO"
|
||||
end
|
||||
|
||||
it "should raise an exception if the action is not implemented" do
|
||||
action_name = :up
|
||||
|
||||
|
|
Loading…
Reference in New Issue