vaguerent/test/vagrant/action/env/error_halt_test.rb
2010-07-19 20:32:07 -07:00

22 lines
488 B
Ruby

require "test_helper"
class ErrorHaltEnvActionTest < Test::Unit::TestCase
setup do
@klass = Vagrant::Action::Env::ErrorHalt
@app, @env = mock_action_data
@instance = @klass.new(@app, @env)
end
should "continue the chain if no error" do
assert !@env.error?
@app.expects(:call).with(@env).once
@instance.call(@env)
end
should "halt the chain if an error occured" do
@env.error!(:foo)
@app.expects(:call).never
@instance.call(@env)
end
end