vaguerent/test/vagrant/action/box/package_test.rb
2010-07-28 07:35:58 -07:00

26 lines
672 B
Ruby

require "test_helper"
class PackageBoxActionTest < Test::Unit::TestCase
setup do
@klass = Vagrant::Action::Box::Package
@app, @env = mock_action_data
@env["box"] = Vagrant::Box.new(mock_environment, "foo")
@instance = @klass.new(@app, @env)
end
should "be a subclass of general packaging middleware" do
assert @instance.is_a?(Vagrant::Action::General::Package)
end
should "set the package directory then call parent" do
@instance.expects(:general_call).once.with() do |env|
assert env["package.directory"]
assert_equal env["package.directory"], @env["box"].directory
true
end
@instance.call(@env)
end
end