core: just don't use ** to avoid symbol/strings mixup
/cc @sethvargo
This commit is contained in:
parent
c4502737c8
commit
6aeae27889
|
@ -150,9 +150,11 @@ module Vagrant
|
||||||
# @param [Hash] extra_env This data will be passed into the action runner
|
# @param [Hash] extra_env This data will be passed into the action runner
|
||||||
# as extra data set on the environment hash for the middleware
|
# as extra data set on the environment hash for the middleware
|
||||||
# runner.
|
# runner.
|
||||||
def action(name, **opts)
|
def action(name, opts=nil)
|
||||||
@logger.info("Calling action: #{name} on provider #{@provider}")
|
@logger.info("Calling action: #{name} on provider #{@provider}")
|
||||||
|
|
||||||
|
opts ||= {}
|
||||||
|
|
||||||
# Determine whether we lock or not
|
# Determine whether we lock or not
|
||||||
lock = true
|
lock = true
|
||||||
lock = opts.delete(:lock) if opts.has_key?(:lock)
|
lock = opts.delete(:lock) if opts.has_key?(:lock)
|
||||||
|
|
|
@ -252,13 +252,24 @@ describe Vagrant::Machine do
|
||||||
expect(machine).to eql(instance)
|
expect(machine).to eql(instance)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "should pass any extra options to the environment" do
|
||||||
|
action_name = :up
|
||||||
|
foo = nil
|
||||||
|
callable = lambda { |env| foo = env[:foo] }
|
||||||
|
|
||||||
|
allow(provider).to receive(:action).with(action_name).and_return(callable)
|
||||||
|
instance.action(:up, foo: :bar)
|
||||||
|
|
||||||
|
expect(foo).to eq(:bar)
|
||||||
|
end
|
||||||
|
|
||||||
it "should pass any extra options to the environment as strings" do
|
it "should pass any extra options to the environment as strings" do
|
||||||
action_name = :up
|
action_name = :up
|
||||||
foo = nil
|
foo = nil
|
||||||
callable = lambda { |env| foo = env["foo"] }
|
callable = lambda { |env| foo = env["foo"] }
|
||||||
|
|
||||||
allow(provider).to receive(:action).with(action_name).and_return(callable)
|
allow(provider).to receive(:action).with(action_name).and_return(callable)
|
||||||
instance.action(:up, foo: :bar)
|
instance.action(:up, "foo" => :bar)
|
||||||
|
|
||||||
expect(foo).to eq(:bar)
|
expect(foo).to eq(:bar)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue