Add test coverage of local rgloader creation
This commit is contained in:
parent
006cea45e3
commit
1c480880f1
|
@ -910,7 +910,7 @@ module Vagrant
|
|||
loader_file = @local_data_path.join("rgloader", "loader.rb")
|
||||
if !loader_file.file?
|
||||
source_loader = Vagrant.source_root.join("templates/rgloader.rb")
|
||||
FileUtils.mkdir_p(@local_data_path.join("rgloader"))
|
||||
FileUtils.mkdir_p(@local_data_path.join("rgloader").to_s)
|
||||
FileUtils.cp(source_loader.to_s, loader_file.to_s)
|
||||
end
|
||||
rescue Errno::EACCES
|
||||
|
|
|
@ -1513,4 +1513,21 @@ VF
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "#setup_local_data_path" do
|
||||
before do
|
||||
allow(FileUtils).to receive(:mkdir_p).and_call_original
|
||||
allow(FileUtils).to receive(:cp).and_call_original
|
||||
end
|
||||
|
||||
it "should create an rgloader path" do
|
||||
expect(FileUtils).to receive(:mkdir_p).with(/(?!home)rgloader/)
|
||||
instance
|
||||
end
|
||||
|
||||
it "should write the rgloader file" do
|
||||
expect(FileUtils).to receive(:cp).with(anything, /(?!home)rgloader.*rb$/)
|
||||
instance
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue