summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-08-16 17:45:00 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2019-08-18 13:45:45 +0900
commit683f9e1dbf42aa4b326b244f1d4dbbbdcb9e8ceb (patch)
treec16edebadd360e0a1d8610f1cd57a3e5b42032ae /spec
parent4756c5f7e79642484d01a7dbca17357eb8b08ef1 (diff)
[bundler/bundler] No need to activate the `fileutils` default gem
The version we're vendoring actually relaxed this restriction back to 2.3.0+, so we can always use the vendored version. https://github.com/bundler/bundler/commit/d366cbfe5d
Diffstat (limited to 'spec')
-rw-r--r--spec/bundler/bundler/bundler_spec.rb2
-rw-r--r--spec/bundler/bundler/settings_spec.rb4
-rw-r--r--spec/bundler/support/helpers.rb8
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