[rubygems/rubygems] Restore the old .gemrc example for compatible tests

https://github.com/rubygems/rubygems/commit/c45d65a06d
This commit is contained in:
Hiroshi SHIBATA 2020-04-29 20:17:43 +09:00
Родитель 4e436e605c
Коммит b9031b1043
1 изменённых файлов: 46 добавлений и 20 удалений

Просмотреть файл

@ -6,6 +6,31 @@ require "cgi"
RSpec.describe Bundler, "friendly errors" do
context "with invalid YAML in .gemrc" do
context "with the old ~/.gemrc" do
before do
File.open(home(".gemrc"), "w") do |f|
f.write "invalid: yaml: hah"
end
end
after do
FileUtils.rm(home(".gemrc"))
end
it "reports a relevant friendly error message" do
gemfile <<-G
source "#{file_uri_for(gem_repo1)}"
gem "rack"
G
bundle :install, :env => { "DEBUG" => "true" }
expect(err).to include("Failed to load #{home(".gemrc")}")
expect(exitstatus).to eq(0) if exitstatus
end
end
context "with XDG_CONFIG_HOME" do
let(:config_home) { File.dirname(Gem.configuration.config_file_name) }
before do
@ -35,6 +60,7 @@ RSpec.describe Bundler, "friendly errors" do
expect(exitstatus).to eq(0) if exitstatus
end
end
end
it "calls log_error in case of exception" do
exception = Exception.new