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
|
||||
# as extra data set on the environment hash for the middleware
|
||||
# runner.
|
||||
def action(name, **opts)
|
||||
def action(name, opts=nil)
|
||||
@logger.info("Calling action: #{name} on provider #{@provider}")
|
||||
|
||||
opts ||= {}
|
||||
|
||||
# Determine whether we lock or not
|
||||
lock = true
|
||||
lock = opts.delete(:lock) if opts.has_key?(:lock)
|
||||
|
|
|
@ -252,13 +252,24 @@ describe Vagrant::Machine do
|
|||
expect(machine).to eql(instance)
|
||||
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
|
||||
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)
|
||||
instance.action(:up, "foo" => :bar)
|
||||
|
||||
expect(foo).to eq(:bar)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue