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:
Mitchell Hashimoto 2012-08-11 20:33:09 -07:00
parent 5e70ad0ec2
commit de0865b9e2
1 changed files with 10 additions and 0 deletions

View File

@ -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