Add test for Action classes with no name

This commit is contained in:
Brian Cain 2019-01-31 09:48:44 -08:00
parent 08214ec90f
commit 64e21a1215
No known key found for this signature in database
GPG Key ID: 9FC4639B2E4510A0
1 changed files with 13 additions and 0 deletions

View File

@ -40,6 +40,19 @@ describe Vagrant::Action::Runner do
expect { instance.run(callable) }.to raise_error(Exception, "BOOM")
end
it "should be able to use a Class as a callable with no name attribute" do
callable = Class.new do
def initialize(app, env)
end
def call(env)
raise Exception, "BOOM"
end
end
expect { instance.run(callable) }.to raise_error(Exception, "BOOM")
end
it "should return the resulting environment" do
callable = lambda do |env|
env[:data] = "value"