mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
Replace File.exists? with File.exist?
File.exists? is deprecated since ruby2.1 and is removed with ruby3.2. Replace with File.exist? .
This commit is contained in:
@@ -71,7 +71,7 @@ shared_context 'libvirt_acceptance' do
|
|||||||
# allows for a helper Vagrantfile to force specific provider options if testing
|
# allows for a helper Vagrantfile to force specific provider options if testing
|
||||||
# environment needs them
|
# environment needs them
|
||||||
vagrantfile = File.join(vagrant_home, 'Vagrantfile')
|
vagrantfile = File.join(vagrant_home, 'Vagrantfile')
|
||||||
if File.exists?(vagrantfile) and !File.exists?(File.join(target_env.homedir, 'Vagrantfile'))
|
if File.exist?(vagrantfile) and !File.exist?(File.join(target_env.homedir, 'Vagrantfile'))
|
||||||
FileUtils.cp(vagrantfile, target_env.homedir)
|
FileUtils.cp(vagrantfile, target_env.homedir)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ require "rspec/expectations/version"
|
|||||||
# end
|
# end
|
||||||
RSpec::Matchers.define :have_file_content do |expected|
|
RSpec::Matchers.define :have_file_content do |expected|
|
||||||
match do |actual|
|
match do |actual|
|
||||||
next false unless File.exists?(actual)
|
next false unless File.exist?(actual)
|
||||||
|
|
||||||
@actual = File.read(actual).chomp
|
@actual = File.read(actual).chomp
|
||||||
@expected = if expected.is_a? String
|
@expected = if expected.is_a? String
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ describe VagrantPlugins::ProviderLibvirt::Action::CleanMachineFolder do
|
|||||||
|
|
||||||
expect(subject.call(env)).to be_nil
|
expect(subject.call(env)).to be_nil
|
||||||
|
|
||||||
expect(File.exists?(machine.data_dir)).to eq(true)
|
expect(File.exist?(machine.data_dir)).to eq(true)
|
||||||
expect(Dir.entries(machine.data_dir)).to match_array([".", ".."])
|
expect(Dir.entries(machine.data_dir)).to match_array([".", ".."])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -38,7 +38,7 @@ describe VagrantPlugins::ProviderLibvirt::Action::CleanMachineFolder do
|
|||||||
|
|
||||||
expect(subject.call(env)).to be_nil
|
expect(subject.call(env)).to be_nil
|
||||||
|
|
||||||
expect(File.exists?(machine.data_dir)).to eq(true)
|
expect(File.exist?(machine.data_dir)).to eq(true)
|
||||||
expect(Dir.entries(machine.data_dir)).to match_array([".", ".."])
|
expect(Dir.entries(machine.data_dir)).to match_array([".", ".."])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -51,7 +51,7 @@ describe VagrantPlugins::ProviderLibvirt::Action::CleanMachineFolder do
|
|||||||
|
|
||||||
expect(subject.call(env)).to be_nil
|
expect(subject.call(env)).to be_nil
|
||||||
|
|
||||||
expect(File.exists?(machine.data_dir)).to eq(true)
|
expect(File.exist?(machine.data_dir)).to eq(true)
|
||||||
expect(Dir.entries(machine.data_dir)).to match_array([".", ".."])
|
expect(Dir.entries(machine.data_dir)).to match_array([".", ".."])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user