vaguerent/test/vagrant/action/environment_test.rb
2010-09-20 09:44:51 -06:00

28 lines
682 B
Ruby

require "test_helper"
class ActionEnvironmentTest < Test::Unit::TestCase
setup do
@klass = Vagrant::Action::Environment
@instance = @klass.new(vagrant_env)
end
should "be a hash with indifferent access" do
assert @instance.is_a?(Vagrant::Util::HashWithIndifferentAccess)
end
should "default values to those on the env" do
@instance.env.stubs(:key).returns("value")
assert_equal "value", @instance["key"]
end
should "setup the UI" do
assert_equal @instance.env.ui, @instance.ui
end
should "report interrupted if interrupt error" do
assert !@instance.interrupted?
@instance.interrupt!
assert @instance.interrupted?
end
end