From 64e21a12159fdd99d0f41b91b26b9ec3f6a0d2a1 Mon Sep 17 00:00:00 2001 From: Brian Cain Date: Thu, 31 Jan 2019 09:48:44 -0800 Subject: [PATCH] Add test for Action classes with no name --- test/unit/vagrant/action/runner_test.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/unit/vagrant/action/runner_test.rb b/test/unit/vagrant/action/runner_test.rb index 329d1032e..7ffc1d14e 100644 --- a/test/unit/vagrant/action/runner_test.rb +++ b/test/unit/vagrant/action/runner_test.rb @@ -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"