diff options
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/bundler/bundler/bundler_spec.rb | 2 | ||||
| -rw-r--r-- | spec/bundler/bundler/settings_spec.rb | 4 | ||||
| -rw-r--r-- | spec/bundler/support/helpers.rb | 8 |
3 files changed, 3 insertions, 11 deletions
diff --git a/spec/bundler/bundler/bundler_spec.rb b/spec/bundler/bundler/bundler_spec.rb index 8a4ce729ed..3cae67c52a 100644 --- a/spec/bundler/bundler/bundler_spec.rb +++ b/spec/bundler/bundler/bundler_spec.rb @@ -176,7 +176,7 @@ RSpec.describe Bundler do let(:bundler_ui) { Bundler.ui } it "should raise a friendly error" do allow(File).to receive(:exist?).and_return(true) - allow(bundler_fileutils).to receive(:remove_entry_secure).and_raise(ArgumentError) + allow(::Bundler::FileUtils).to receive(:remove_entry_secure).and_raise(ArgumentError) allow(File).to receive(:world_writable?).and_return(true) message = <<EOF It is a security vulnerability to allow your home directory to be world-writable, and bundler can not continue. diff --git a/spec/bundler/bundler/settings_spec.rb b/spec/bundler/bundler/settings_spec.rb index 339428eb48..7e1dadded7 100644 --- a/spec/bundler/bundler/settings_spec.rb +++ b/spec/bundler/bundler/settings_spec.rb @@ -120,7 +120,7 @@ that would suck --ehhh=oh geez it looks like i might have broken bundler somehow context "when it's not possible to write to the file" do it "raises an PermissionError with explanation" do - expect(bundler_fileutils).to receive(:mkdir_p).with(settings.send(:local_config_file).dirname). + expect(::Bundler::FileUtils).to receive(:mkdir_p).with(settings.send(:local_config_file).dirname). and_raise(Errno::EACCES) expect { settings.set_local :frozen, "1" }. to raise_error(Bundler::PermissionError, /config/) @@ -161,7 +161,7 @@ that would suck --ehhh=oh geez it looks like i might have broken bundler somehow describe "#set_global" do context "when it's not possible to write to the file" do it "raises an PermissionError with explanation" do - expect(bundler_fileutils).to receive(:mkdir_p).with(settings.send(:global_config_file).dirname). + expect(::Bundler::FileUtils).to receive(:mkdir_p).with(settings.send(:global_config_file).dirname). and_raise(Errno::EACCES) expect { settings.set_global(:frozen, "1") }. to raise_error(Bundler::PermissionError, %r{\.bundle/config}) diff --git a/spec/bundler/support/helpers.rb b/spec/bundler/support/helpers.rb index f069911f65..0c05789946 100644 --- a/spec/bundler/support/helpers.rb +++ b/spec/bundler/support/helpers.rb @@ -593,13 +593,5 @@ module Spec end port end - - def bundler_fileutils - if RUBY_VERSION >= "2.4" - ::Bundler::FileUtils - else - ::FileUtils - end - end end end |
