summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/bundler/bundler/env_spec.rb10
-rw-r--r--spec/bundler/bundler/friendly_errors_spec.rb9
2 files changed, 16 insertions, 3 deletions
diff --git a/spec/bundler/bundler/env_spec.rb b/spec/bundler/bundler/env_spec.rb
index 7686fe386a..9631a109bd 100644
--- a/spec/bundler/bundler/env_spec.rb
+++ b/spec/bundler/bundler/env_spec.rb
@@ -41,9 +41,15 @@ RSpec.describe Bundler::Env do
end
it "prints user path" do
- with_clear_paths("HOME", "/a/b/c") do
+ if Gem::VERSION >= "3.2.0.pre.1"
+ allow(Gem).to receive(:data_home) { "/a/b/c/.local/share" }
out = described_class.report
- expect(out).to include("User Path /a/b/c/.gem")
+ expect(out).to include("User Path /a/b/c/.local/share/gem")
+ else
+ with_clear_paths("HOME", "/a/b/c") do
+ out = described_class.report
+ expect(out).to include("User Path /a/b/c/.gem")
+ end
end
end
diff --git a/spec/bundler/bundler/friendly_errors_spec.rb b/spec/bundler/bundler/friendly_errors_spec.rb
index e9189b0514..8df653c0f1 100644
--- a/spec/bundler/bundler/friendly_errors_spec.rb
+++ b/spec/bundler/bundler/friendly_errors_spec.rb
@@ -6,7 +6,10 @@ require "cgi"
RSpec.describe Bundler, "friendly errors" do
context "with invalid YAML in .gemrc" do
+ let(:config_home) { File.dirname(Gem.configuration.config_file_name) }
+
before do
+ FileUtils.mkdir_p config_home
File.open(Gem.configuration.config_file_name, "w") do |f|
f.write "invalid: yaml: hah"
end
@@ -24,7 +27,11 @@ RSpec.describe Bundler, "friendly errors" do
bundle :install, :env => { "DEBUG" => "true" }
- expect(err).to include("Failed to load #{home(".gemrc")}")
+ if Gem::VERSION >= "3.2.0.pre.1"
+ expect(err).to include("Failed to load #{File.join(config_home, "gemrc")}")
+ else
+ expect(err).to include("Failed to load #{home(".gemrc")}")
+ end
expect(exitstatus).to eq(0) if exitstatus
end
end