kernel/v2: multiple synced folder lines override each other
This commit is contained in:
parent
92940a7c5d
commit
a9029842a6
|
@ -184,9 +184,11 @@ module VagrantPlugins
|
|||
end
|
||||
|
||||
options ||= {}
|
||||
options = options.dup
|
||||
options[:guestpath] = guestpath.to_s.gsub(/\/$/, '')
|
||||
options[:hostpath] = hostpath
|
||||
options = (@__synced_folders[options[:guestpath]] || {}).
|
||||
merge(options.dup)
|
||||
|
||||
# Make sure the type is a symbol
|
||||
options[:type] = options[:type].to_sym if options[:type]
|
||||
|
||||
|
|
|
@ -410,6 +410,17 @@ describe VagrantPlugins::Kernel_V2::VMConfig do
|
|||
expect(sf).to have_key("/vagrant")
|
||||
expect(sf["/vagrant"][:disabled]).to be_true
|
||||
end
|
||||
|
||||
it "allows overriding previously set options" do
|
||||
subject.synced_folder(".", "/vagrant", disabled: true)
|
||||
subject.synced_folder(".", "/vagrant", foo: :bar)
|
||||
subject.finalize!
|
||||
sf = subject.synced_folders
|
||||
expect(sf.length).to eq(1)
|
||||
expect(sf).to have_key("/vagrant")
|
||||
expect(sf["/vagrant"][:disabled]).to be_true
|
||||
expect(sf["/vagrant"][:foo]).to eq(:bar)
|
||||
end
|
||||
end
|
||||
|
||||
describe "#usable_port_range" do
|
||||
|
|
Loading…
Reference in New Issue