diff --git a/lib/bundler/vendored_fileutils.rb b/lib/bundler/vendored_fileutils.rb index 4b71759224e..1be1138ce25 100644 --- a/lib/bundler/vendored_fileutils.rb +++ b/lib/bundler/vendored_fileutils.rb @@ -1,9 +1,4 @@ # frozen_string_literal: true module Bundler; end -if RUBY_VERSION >= "2.4" - require_relative "vendor/fileutils/lib/fileutils" -else - # the version we vendor is 2.4+ - require "fileutils" -end +require_relative "vendor/fileutils/lib/fileutils" diff --git a/spec/bundler/bundler_spec.rb b/spec/bundler/bundler_spec.rb index 8a4ce729edd..3cae67c52a9 100644 --- a/spec/bundler/bundler_spec.rb +++ b/spec/bundler/bundler_spec.rb @@ -176,7 +176,7 @@ 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 = <= "2.4" - ::Bundler::FileUtils - else - ::FileUtils - end - end end end