core: use keyword args to simplify BoxCollection#add

This commit is contained in:
Mitchell Hashimoto 2013-12-01 22:20:51 -08:00
parent 9be6b4f0d3
commit 4281af338f
2 changed files with 2 additions and 2 deletions

View File

@ -70,7 +70,7 @@ module Vagrant
# the box represents will be added.
# @param [Boolean] force If true, any existing box with the same name
# and provider will be replaced.
def add(path, name, formats=nil, force=false)
def add(path, name, formats=nil, force: false)
formats = [formats] if formats && !formats.is_a?(Array)
provider = nil

View File

@ -72,7 +72,7 @@ describe Vagrant::BoxCollection do
# Attempt to add the box with the same name
box_path = environment.box2_file(prev_box_provider, metadata: { "replaced" => "yes" })
box = instance.add(box_path, prev_box_name, nil, true)
box = instance.add(box_path, prev_box_name, nil, force: true)
box.metadata["replaced"].should == "yes"
end