mirror of
https://github.com/ruby/ruby.git
synced 2025-08-24 21:44:30 +02:00
[rubygems/rubygems] Prefer squiggly heredocs over custom helper
258476c38a
This commit is contained in:
parent
5a43b0ddd5
commit
0e7536bf49
17 changed files with 51 additions and 51 deletions
|
@ -76,7 +76,7 @@ RSpec.describe Bundler do
|
||||||
context "with incorrect YAML file" do
|
context "with incorrect YAML file" do
|
||||||
before do
|
before do
|
||||||
File.open(app_gemspec_path, "wb") do |f|
|
File.open(app_gemspec_path, "wb") do |f|
|
||||||
f.write strip_whitespace(<<-GEMSPEC)
|
f.write <<~GEMSPEC
|
||||||
---
|
---
|
||||||
{:!00 ao=gu\g1= 7~f
|
{:!00 ao=gu\g1= 7~f
|
||||||
GEMSPEC
|
GEMSPEC
|
||||||
|
@ -147,7 +147,7 @@ RSpec.describe Bundler do
|
||||||
context "with gemspec containing local variables" do
|
context "with gemspec containing local variables" do
|
||||||
before do
|
before do
|
||||||
File.open(app_gemspec_path, "wb") do |f|
|
File.open(app_gemspec_path, "wb") do |f|
|
||||||
f.write strip_whitespace(<<-GEMSPEC)
|
f.write <<~GEMSPEC
|
||||||
must_not_leak = true
|
must_not_leak = true
|
||||||
Gem::Specification.new do |gem|
|
Gem::Specification.new do |gem|
|
||||||
gem.name = "leak check"
|
gem.name = "leak check"
|
||||||
|
|
|
@ -139,7 +139,7 @@ RSpec.describe Bundler::Env do
|
||||||
|
|
||||||
context "when Gemfile contains a gemspec and print_gemspecs is true" do
|
context "when Gemfile contains a gemspec and print_gemspecs is true" do
|
||||||
let(:gemspec) do
|
let(:gemspec) do
|
||||||
strip_whitespace(<<-GEMSPEC)
|
<<~GEMSPEC
|
||||||
Gem::Specification.new do |gem|
|
Gem::Specification.new do |gem|
|
||||||
gem.name = "foo"
|
gem.name = "foo"
|
||||||
gem.author = "Fumofu"
|
gem.author = "Fumofu"
|
||||||
|
@ -178,7 +178,7 @@ RSpec.describe Bundler::Env do
|
||||||
allow(Bundler::SharedHelpers).to receive(:pwd).and_return(bundled_app)
|
allow(Bundler::SharedHelpers).to receive(:pwd).and_return(bundled_app)
|
||||||
|
|
||||||
output = described_class.report(:print_gemspecs => true)
|
output = described_class.report(:print_gemspecs => true)
|
||||||
expect(output).to include(strip_whitespace(<<-ENV))
|
expect(output).to include(<<~ENV)
|
||||||
## Gemfile
|
## Gemfile
|
||||||
|
|
||||||
### Gemfile
|
### Gemfile
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
require "bundler/lockfile_parser"
|
require "bundler/lockfile_parser"
|
||||||
|
|
||||||
RSpec.describe Bundler::LockfileParser do
|
RSpec.describe Bundler::LockfileParser do
|
||||||
let(:lockfile_contents) { strip_whitespace(<<-L) }
|
let(:lockfile_contents) { <<~L }
|
||||||
GIT
|
GIT
|
||||||
remote: https://github.com/alloy/peiji-san.git
|
remote: https://github.com/alloy/peiji-san.git
|
||||||
revision: eca485d8dc95f12aaec1a434b49d295c7e91844b
|
revision: eca485d8dc95f12aaec1a434b49d295c7e91844b
|
||||||
|
@ -39,7 +39,7 @@ RSpec.describe Bundler::LockfileParser do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe ".unknown_sections_in_lockfile" do
|
describe ".unknown_sections_in_lockfile" do
|
||||||
let(:lockfile_contents) { strip_whitespace(<<-L) }
|
let(:lockfile_contents) { <<~L }
|
||||||
UNKNOWN ATTR
|
UNKNOWN ATTR
|
||||||
|
|
||||||
UNKNOWN ATTR 2
|
UNKNOWN ATTR 2
|
||||||
|
|
|
@ -51,7 +51,7 @@ RSpec.describe Bundler::Plugin::API::Source do
|
||||||
|
|
||||||
context "to_lock" do
|
context "to_lock" do
|
||||||
it "returns the string with remote and type" do
|
it "returns the string with remote and type" do
|
||||||
expected = strip_whitespace <<-L
|
expected = <<~L
|
||||||
PLUGIN SOURCE
|
PLUGIN SOURCE
|
||||||
remote: #{uri}
|
remote: #{uri}
|
||||||
type: #{type}
|
type: #{type}
|
||||||
|
@ -67,7 +67,7 @@ RSpec.describe Bundler::Plugin::API::Source do
|
||||||
end
|
end
|
||||||
|
|
||||||
it "includes them" do
|
it "includes them" do
|
||||||
expected = strip_whitespace <<-L
|
expected = <<~L
|
||||||
PLUGIN SOURCE
|
PLUGIN SOURCE
|
||||||
remote: #{uri}
|
remote: #{uri}
|
||||||
type: #{type}
|
type: #{type}
|
||||||
|
|
|
@ -44,14 +44,14 @@ RSpec.describe Bundler::Settings::Validator do
|
||||||
validate!("without", "b:c", "BUNDLE_WITH" => "a")
|
validate!("without", "b:c", "BUNDLE_WITH" => "a")
|
||||||
end.not_to raise_error
|
end.not_to raise_error
|
||||||
|
|
||||||
expect { validate!("with", "b:c", "BUNDLE_WITHOUT" => "c:d") }.to raise_error Bundler::InvalidOption, strip_whitespace(<<-EOS).strip
|
expect { validate!("with", "b:c", "BUNDLE_WITHOUT" => "c:d") }.to raise_error Bundler::InvalidOption, <<~EOS.strip
|
||||||
Setting `with` to "b:c" failed:
|
Setting `with` to "b:c" failed:
|
||||||
- a group cannot be in both `with` & `without` simultaneously
|
- a group cannot be in both `with` & `without` simultaneously
|
||||||
- `without` is current set to [:c, :d]
|
- `without` is current set to [:c, :d]
|
||||||
- the `c` groups conflict
|
- the `c` groups conflict
|
||||||
EOS
|
EOS
|
||||||
|
|
||||||
expect { validate!("without", "b:c", "BUNDLE_WITH" => "c:d") }.to raise_error Bundler::InvalidOption, strip_whitespace(<<-EOS).strip
|
expect { validate!("without", "b:c", "BUNDLE_WITH" => "c:d") }.to raise_error Bundler::InvalidOption, <<~EOS.strip
|
||||||
Setting `without` to "b:c" failed:
|
Setting `without` to "b:c" failed:
|
||||||
- a group cannot be in both `with` & `without` simultaneously
|
- a group cannot be in both `with` & `without` simultaneously
|
||||||
- `with` is current set to [:c, :d]
|
- `with` is current set to [:c, :d]
|
||||||
|
@ -74,7 +74,7 @@ RSpec.describe Bundler::Settings::Validator do
|
||||||
|
|
||||||
describe "#fail!" do
|
describe "#fail!" do
|
||||||
it "raises with a helpful message" do
|
it "raises with a helpful message" do
|
||||||
expect { subject.fail!("key", "value", "reason1", "reason2") }.to raise_error Bundler::InvalidOption, strip_whitespace(<<-EOS).strip
|
expect { subject.fail!("key", "value", "reason1", "reason2") }.to raise_error Bundler::InvalidOption, <<~EOS.strip
|
||||||
Setting `key` to "value" failed:
|
Setting `key` to "value" failed:
|
||||||
- rule description
|
- rule description
|
||||||
- reason1
|
- reason1
|
||||||
|
|
|
@ -9,7 +9,7 @@ RSpec.describe Bundler::YAMLSerializer do
|
||||||
it "works for simple hash" do
|
it "works for simple hash" do
|
||||||
hash = { "Q" => "Where does Thursday come before Wednesday? In the dictionary. :P" }
|
hash = { "Q" => "Where does Thursday come before Wednesday? In the dictionary. :P" }
|
||||||
|
|
||||||
expected = strip_whitespace <<-YAML
|
expected = <<~YAML
|
||||||
---
|
---
|
||||||
Q: "Where does Thursday come before Wednesday? In the dictionary. :P"
|
Q: "Where does Thursday come before Wednesday? In the dictionary. :P"
|
||||||
YAML
|
YAML
|
||||||
|
@ -24,7 +24,7 @@ RSpec.describe Bundler::YAMLSerializer do
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
expected = strip_whitespace <<-YAML
|
expected = <<~YAML
|
||||||
---
|
---
|
||||||
nice-one:
|
nice-one:
|
||||||
read_ahead: "All generalizations are false, including this one"
|
read_ahead: "All generalizations are false, including this one"
|
||||||
|
@ -45,7 +45,7 @@ RSpec.describe Bundler::YAMLSerializer do
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
expected = strip_whitespace <<-YAML
|
expected = <<~YAML
|
||||||
---
|
---
|
||||||
nested_hash:
|
nested_hash:
|
||||||
contains_array:
|
contains_array:
|
||||||
|
@ -61,7 +61,7 @@ RSpec.describe Bundler::YAMLSerializer do
|
||||||
|
|
||||||
describe "#load" do
|
describe "#load" do
|
||||||
it "works for simple hash" do
|
it "works for simple hash" do
|
||||||
yaml = strip_whitespace <<-YAML
|
yaml = <<~YAML
|
||||||
---
|
---
|
||||||
Jon: "Air is free dude!"
|
Jon: "Air is free dude!"
|
||||||
Jack: "Yes.. until you buy a bag of chips!"
|
Jack: "Yes.. until you buy a bag of chips!"
|
||||||
|
@ -76,7 +76,7 @@ RSpec.describe Bundler::YAMLSerializer do
|
||||||
end
|
end
|
||||||
|
|
||||||
it "works for nested hash" do
|
it "works for nested hash" do
|
||||||
yaml = strip_whitespace <<-YAML
|
yaml = <<~YAML
|
||||||
---
|
---
|
||||||
baa:
|
baa:
|
||||||
baa: "black sheep"
|
baa: "black sheep"
|
||||||
|
@ -98,7 +98,7 @@ RSpec.describe Bundler::YAMLSerializer do
|
||||||
end
|
end
|
||||||
|
|
||||||
it "handles colon in key/value" do
|
it "handles colon in key/value" do
|
||||||
yaml = strip_whitespace <<-YAML
|
yaml = <<~YAML
|
||||||
BUNDLE_MIRROR__HTTPS://RUBYGEMS__ORG/: http://rubygems-mirror.org
|
BUNDLE_MIRROR__HTTPS://RUBYGEMS__ORG/: http://rubygems-mirror.org
|
||||||
YAML
|
YAML
|
||||||
|
|
||||||
|
@ -106,7 +106,7 @@ RSpec.describe Bundler::YAMLSerializer do
|
||||||
end
|
end
|
||||||
|
|
||||||
it "handles arrays inside hashes" do
|
it "handles arrays inside hashes" do
|
||||||
yaml = strip_whitespace <<-YAML
|
yaml = <<~YAML
|
||||||
---
|
---
|
||||||
nested_hash:
|
nested_hash:
|
||||||
contains_array:
|
contains_array:
|
||||||
|
@ -127,7 +127,7 @@ RSpec.describe Bundler::YAMLSerializer do
|
||||||
end
|
end
|
||||||
|
|
||||||
it "handles windows-style CRLF line endings" do
|
it "handles windows-style CRLF line endings" do
|
||||||
yaml = strip_whitespace(<<-YAML).gsub("\n", "\r\n")
|
yaml = <<~YAML.gsub("\n", "\r\n")
|
||||||
---
|
---
|
||||||
nested_hash:
|
nested_hash:
|
||||||
contains_array:
|
contains_array:
|
||||||
|
|
|
@ -59,7 +59,7 @@ RSpec.describe "bundle doctor" do
|
||||||
expect(doctor).to receive(:bundles_for_gem).exactly(2).times.and_return ["/path/to/rack/rack.bundle"]
|
expect(doctor).to receive(:bundles_for_gem).exactly(2).times.and_return ["/path/to/rack/rack.bundle"]
|
||||||
expect(doctor).to receive(:dylibs).exactly(2).times.and_return ["/usr/local/opt/icu4c/lib/libicui18n.57.1.dylib"]
|
expect(doctor).to receive(:dylibs).exactly(2).times.and_return ["/usr/local/opt/icu4c/lib/libicui18n.57.1.dylib"]
|
||||||
allow(Fiddle).to receive(:dlopen).with("/usr/local/opt/icu4c/lib/libicui18n.57.1.dylib").and_raise(Fiddle::DLError)
|
allow(Fiddle).to receive(:dlopen).with("/usr/local/opt/icu4c/lib/libicui18n.57.1.dylib").and_raise(Fiddle::DLError)
|
||||||
expect { doctor.run }.to raise_error(Bundler::ProductionError, strip_whitespace(<<-E).strip), @stdout.string
|
expect { doctor.run }.to raise_error(Bundler::ProductionError, <<~E.strip), @stdout.string
|
||||||
The following gems are missing OS dependencies:
|
The following gems are missing OS dependencies:
|
||||||
* bundler: /usr/local/opt/icu4c/lib/libicui18n.57.1.dylib
|
* bundler: /usr/local/opt/icu4c/lib/libicui18n.57.1.dylib
|
||||||
* rack: /usr/local/opt/icu4c/lib/libicui18n.57.1.dylib
|
* rack: /usr/local/opt/icu4c/lib/libicui18n.57.1.dylib
|
||||||
|
|
|
@ -1024,7 +1024,7 @@ __FILE__: #{path.to_s.inspect}
|
||||||
end
|
end
|
||||||
|
|
||||||
context "signals being trapped by bundler" do
|
context "signals being trapped by bundler" do
|
||||||
let(:executable) { strip_whitespace <<-RUBY }
|
let(:executable) { <<~RUBY }
|
||||||
#{shebang}
|
#{shebang}
|
||||||
begin
|
begin
|
||||||
Thread.new do
|
Thread.new do
|
||||||
|
@ -1051,7 +1051,7 @@ __FILE__: #{path.to_s.inspect}
|
||||||
end
|
end
|
||||||
|
|
||||||
context "signals not being trapped by bunder" do
|
context "signals not being trapped by bunder" do
|
||||||
let(:executable) { strip_whitespace <<-RUBY }
|
let(:executable) { <<~RUBY }
|
||||||
#{shebang}
|
#{shebang}
|
||||||
|
|
||||||
signals = #{test_signals.inspect}
|
signals = #{test_signals.inspect}
|
||||||
|
|
|
@ -651,7 +651,7 @@ RSpec.describe "bundle gem" do
|
||||||
|
|
||||||
system_gems ["rake-13.0.1"]
|
system_gems ["rake-13.0.1"]
|
||||||
|
|
||||||
rakefile = strip_whitespace <<-RAKEFILE
|
rakefile = <<~RAKEFILE
|
||||||
task :default do
|
task :default do
|
||||||
puts 'SUCCESS'
|
puts 'SUCCESS'
|
||||||
end
|
end
|
||||||
|
@ -797,7 +797,7 @@ RSpec.describe "bundle gem" do
|
||||||
end
|
end
|
||||||
|
|
||||||
it "creates a default rake task to run the test suite" do
|
it "creates a default rake task to run the test suite" do
|
||||||
rakefile = strip_whitespace <<-RAKEFILE
|
rakefile = <<~RAKEFILE
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "bundler/gem_tasks"
|
require "bundler/gem_tasks"
|
||||||
|
@ -855,7 +855,7 @@ RSpec.describe "bundle gem" do
|
||||||
end
|
end
|
||||||
|
|
||||||
it "creates a default rake task to run the test suite" do
|
it "creates a default rake task to run the test suite" do
|
||||||
rakefile = strip_whitespace <<-RAKEFILE
|
rakefile = <<~RAKEFILE
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "bundler/gem_tasks"
|
require "bundler/gem_tasks"
|
||||||
|
@ -1419,7 +1419,7 @@ RSpec.describe "bundle gem" do
|
||||||
end
|
end
|
||||||
|
|
||||||
it "depends on compile task for build" do
|
it "depends on compile task for build" do
|
||||||
rakefile = strip_whitespace <<-RAKEFILE
|
rakefile = <<~RAKEFILE
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "bundler/gem_tasks"
|
require "bundler/gem_tasks"
|
||||||
|
@ -1477,7 +1477,7 @@ RSpec.describe "bundle gem" do
|
||||||
end
|
end
|
||||||
|
|
||||||
it "depends on compile task for build" do
|
it "depends on compile task for build" do
|
||||||
rakefile = strip_whitespace <<-RAKEFILE
|
rakefile = <<~RAKEFILE
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "bundler/gem_tasks"
|
require "bundler/gem_tasks"
|
||||||
|
@ -1583,7 +1583,7 @@ Usage: "bundle gem NAME [OPTIONS]"
|
||||||
end
|
end
|
||||||
|
|
||||||
expect(bundled_app("foobar/spec/spec_helper.rb")).to exist
|
expect(bundled_app("foobar/spec/spec_helper.rb")).to exist
|
||||||
rakefile = strip_whitespace <<-RAKEFILE
|
rakefile = <<~RAKEFILE
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "bundler/gem_tasks"
|
require "bundler/gem_tasks"
|
||||||
|
|
|
@ -16,7 +16,7 @@ RSpec.describe "bundle viz", :bundler => "< 3", :if => Bundler.which("dot"), :re
|
||||||
expect(out).to include("gem_graph.png")
|
expect(out).to include("gem_graph.png")
|
||||||
|
|
||||||
bundle "viz", :format => "debug"
|
bundle "viz", :format => "debug"
|
||||||
expect(out).to eq(strip_whitespace(<<-DOT).strip)
|
expect(out).to eq(<<~DOT.strip)
|
||||||
digraph Gemfile {
|
digraph Gemfile {
|
||||||
concentrate = "true";
|
concentrate = "true";
|
||||||
normalize = "true";
|
normalize = "true";
|
||||||
|
@ -50,7 +50,7 @@ RSpec.describe "bundle viz", :bundler => "< 3", :if => Bundler.which("dot"), :re
|
||||||
expect(out).to include("gem_graph.png")
|
expect(out).to include("gem_graph.png")
|
||||||
|
|
||||||
bundle "viz", :format => :debug, :version => true
|
bundle "viz", :format => :debug, :version => true
|
||||||
expect(out).to eq(strip_whitespace(<<-EOS).strip)
|
expect(out).to eq(<<~EOS.strip)
|
||||||
digraph Gemfile {
|
digraph Gemfile {
|
||||||
concentrate = "true";
|
concentrate = "true";
|
||||||
normalize = "true";
|
normalize = "true";
|
||||||
|
@ -88,7 +88,7 @@ RSpec.describe "bundle viz", :bundler => "< 3", :if => Bundler.which("dot"), :re
|
||||||
G
|
G
|
||||||
|
|
||||||
bundle "viz", :format => "debug"
|
bundle "viz", :format => "debug"
|
||||||
expect(out).to eq(strip_whitespace(<<-DOT).strip)
|
expect(out).to eq(<<~DOT.strip)
|
||||||
digraph Gemfile {
|
digraph Gemfile {
|
||||||
concentrate = "true";
|
concentrate = "true";
|
||||||
normalize = "true";
|
normalize = "true";
|
||||||
|
|
|
@ -51,7 +51,7 @@ RSpec.describe "bundle install with :allow_offline_install" do
|
||||||
def break_git_remote_ops!
|
def break_git_remote_ops!
|
||||||
FileUtils.mkdir_p(tmp("broken_path"))
|
FileUtils.mkdir_p(tmp("broken_path"))
|
||||||
File.open(tmp("broken_path/git"), "w", 0o755) do |f|
|
File.open(tmp("broken_path/git"), "w", 0o755) do |f|
|
||||||
f.puts strip_whitespace(<<-RUBY)
|
f.puts <<~RUBY
|
||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
fetch_args = %w(fetch --force --quiet)
|
fetch_args = %w(fetch --force --quiet)
|
||||||
clone_args = %w(clone --bare --no-hardlinks --quiet)
|
clone_args = %w(clone --bare --no-hardlinks --quiet)
|
||||||
|
|
|
@ -506,7 +506,7 @@ RSpec.describe "install in deployment or frozen mode" do
|
||||||
G
|
G
|
||||||
|
|
||||||
run "require 'rack'", :raise_on_error => false
|
run "require 'rack'", :raise_on_error => false
|
||||||
expect(err).to include strip_whitespace(<<-E).strip
|
expect(err).to include <<~E.strip
|
||||||
The dependencies in your gemfile changed, but the lockfile can't be updated because frozen mode is set (Bundler::ProductionError)
|
The dependencies in your gemfile changed, but the lockfile can't be updated because frozen mode is set (Bundler::ProductionError)
|
||||||
|
|
||||||
You have added to the Gemfile:
|
You have added to the Gemfile:
|
||||||
|
|
|
@ -448,7 +448,7 @@ RSpec.describe "bundle install from an existing gemspec" do
|
||||||
context "as a runtime dependency" do
|
context "as a runtime dependency" do
|
||||||
it "keeps all platform dependencies in the lockfile" do
|
it "keeps all platform dependencies in the lockfile" do
|
||||||
expect(the_bundle).to include_gems "foo 1.0", "platform_specific 1.0 RUBY"
|
expect(the_bundle).to include_gems "foo 1.0", "platform_specific 1.0 RUBY"
|
||||||
expect(lockfile).to eq strip_whitespace(<<-L)
|
expect(lockfile).to eq <<~L
|
||||||
PATH
|
PATH
|
||||||
remote: .
|
remote: .
|
||||||
specs:
|
specs:
|
||||||
|
@ -481,7 +481,7 @@ RSpec.describe "bundle install from an existing gemspec" do
|
||||||
|
|
||||||
it "keeps all platform dependencies in the lockfile" do
|
it "keeps all platform dependencies in the lockfile" do
|
||||||
expect(the_bundle).to include_gems "foo 1.0", "platform_specific 1.0 RUBY"
|
expect(the_bundle).to include_gems "foo 1.0", "platform_specific 1.0 RUBY"
|
||||||
expect(lockfile).to eq strip_whitespace(<<-L)
|
expect(lockfile).to eq <<~L
|
||||||
PATH
|
PATH
|
||||||
remote: .
|
remote: .
|
||||||
specs:
|
specs:
|
||||||
|
@ -515,7 +515,7 @@ RSpec.describe "bundle install from an existing gemspec" do
|
||||||
|
|
||||||
it "keeps all platform dependencies in the lockfile" do
|
it "keeps all platform dependencies in the lockfile" do
|
||||||
expect(the_bundle).to include_gems "foo 1.0", "indirect_platform_specific 1.0", "platform_specific 1.0 RUBY"
|
expect(the_bundle).to include_gems "foo 1.0", "indirect_platform_specific 1.0", "platform_specific 1.0 RUBY"
|
||||||
expect(lockfile).to eq strip_whitespace(<<-L)
|
expect(lockfile).to eq <<~L
|
||||||
PATH
|
PATH
|
||||||
remote: .
|
remote: .
|
||||||
specs:
|
specs:
|
||||||
|
|
|
@ -1374,7 +1374,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
|
||||||
gem "thin"
|
gem "thin"
|
||||||
end
|
end
|
||||||
G
|
G
|
||||||
expect(err).to eq strip_whitespace(<<-EOS).strip
|
expect(err).to eq <<~EOS.strip
|
||||||
Warning: The gem 'rack' was found in multiple relevant sources.
|
Warning: The gem 'rack' was found in multiple relevant sources.
|
||||||
* rubygems repository https://gem.repo1/
|
* rubygems repository https://gem.repo1/
|
||||||
* rubygems repository https://gem.repo4/
|
* rubygems repository https://gem.repo4/
|
||||||
|
@ -1404,7 +1404,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
|
||||||
end
|
end
|
||||||
G
|
G
|
||||||
expect(last_command).to be_failure
|
expect(last_command).to be_failure
|
||||||
expect(err).to eq strip_whitespace(<<-EOS).strip
|
expect(err).to eq <<~EOS.strip
|
||||||
The gem 'rack' was found in multiple relevant sources.
|
The gem 'rack' was found in multiple relevant sources.
|
||||||
* rubygems repository https://gem.repo1/
|
* rubygems repository https://gem.repo1/
|
||||||
* rubygems repository https://gem.repo4/
|
* rubygems repository https://gem.repo4/
|
||||||
|
|
|
@ -289,7 +289,7 @@ The checksum of /versions does not match the checksum provided by the server! So
|
||||||
|
|
||||||
system_gems %w[rack-1.0.0 thin-1.0 net_a-1.0], :gem_repo => gem_repo2
|
system_gems %w[rack-1.0.0 thin-1.0 net_a-1.0], :gem_repo => gem_repo2
|
||||||
bundle "config set --local path.system true"
|
bundle "config set --local path.system true"
|
||||||
ENV["BUNDLER_SPEC_ALL_REQUESTS"] = strip_whitespace(<<-EOS).strip
|
ENV["BUNDLER_SPEC_ALL_REQUESTS"] = <<~EOS.strip
|
||||||
#{source_uri}/versions
|
#{source_uri}/versions
|
||||||
#{source_uri}/info/rack
|
#{source_uri}/info/rack
|
||||||
EOS
|
EOS
|
||||||
|
|
|
@ -415,7 +415,7 @@ RSpec.describe "bundle install with install-time dependencies" do
|
||||||
bundle "install", :raise_on_error => false
|
bundle "install", :raise_on_error => false
|
||||||
end
|
end
|
||||||
|
|
||||||
nice_error = strip_whitespace(<<-E).strip
|
nice_error = <<~E.strip
|
||||||
Could not find gem 'sorbet-static (= 0.5.10554)' with platforms 'arm64-darwin-21', 'aarch64-linux' in rubygems repository #{file_uri_for(gem_repo4)}/ or installed locally.
|
Could not find gem 'sorbet-static (= 0.5.10554)' with platforms 'arm64-darwin-21', 'aarch64-linux' in rubygems repository #{file_uri_for(gem_repo4)}/ or installed locally.
|
||||||
|
|
||||||
The source contains the following gems matching 'sorbet-static (= 0.5.10554)':
|
The source contains the following gems matching 'sorbet-static (= 0.5.10554)':
|
||||||
|
@ -521,7 +521,7 @@ RSpec.describe "bundle install with install-time dependencies" do
|
||||||
|
|
||||||
expect(out).to_not include("Gem::InstallError: require_ruby requires Ruby version > 9000")
|
expect(out).to_not include("Gem::InstallError: require_ruby requires Ruby version > 9000")
|
||||||
|
|
||||||
nice_error = strip_whitespace(<<-E).strip
|
nice_error = <<~E.strip
|
||||||
Could not find compatible versions
|
Could not find compatible versions
|
||||||
|
|
||||||
Because every version of require_ruby depends on Ruby > 9000
|
Because every version of require_ruby depends on Ruby > 9000
|
||||||
|
@ -543,7 +543,7 @@ RSpec.describe "bundle install with install-time dependencies" do
|
||||||
|
|
||||||
expect(out).to_not include("Gem::InstallError: require_ruby requires Ruby version > 9000")
|
expect(out).to_not include("Gem::InstallError: require_ruby requires Ruby version > 9000")
|
||||||
|
|
||||||
nice_error = strip_whitespace(<<-E).strip
|
nice_error = <<~E.strip
|
||||||
Could not find compatible versions
|
Could not find compatible versions
|
||||||
|
|
||||||
Because every version of require_ruby depends on Ruby > 9000
|
Because every version of require_ruby depends on Ruby > 9000
|
||||||
|
@ -587,7 +587,7 @@ RSpec.describe "bundle install with install-time dependencies" do
|
||||||
G
|
G
|
||||||
|
|
||||||
expect(err).to_not include("Gem::InstallError: require_rubygems requires RubyGems version > 9000")
|
expect(err).to_not include("Gem::InstallError: require_rubygems requires RubyGems version > 9000")
|
||||||
nice_error = strip_whitespace(<<-E).strip
|
nice_error = <<~E.strip
|
||||||
Because every version of require_rubygems depends on RubyGems > 9000
|
Because every version of require_rubygems depends on RubyGems > 9000
|
||||||
and Gemfile depends on require_rubygems >= 0,
|
and Gemfile depends on require_rubygems >= 0,
|
||||||
RubyGems > 9000 is required.
|
RubyGems > 9000 is required.
|
||||||
|
|
|
@ -1316,7 +1316,7 @@ end
|
||||||
exempts
|
exempts
|
||||||
end
|
end
|
||||||
|
|
||||||
let(:activation_warning_hack) { strip_whitespace(<<-RUBY) }
|
let(:activation_warning_hack) { <<~RUBY }
|
||||||
require #{spec_dir.join("support/hax").to_s.dump}
|
require #{spec_dir.join("support/hax").to_s.dump}
|
||||||
|
|
||||||
Gem::Specification.send(:alias_method, :bundler_spec_activate, :activate)
|
Gem::Specification.send(:alias_method, :bundler_spec_activate, :activate)
|
||||||
|
@ -1336,7 +1336,7 @@ end
|
||||||
"-r#{bundled_app("activation_warning_hack.rb")} #{ENV["RUBYOPT"]}"
|
"-r#{bundled_app("activation_warning_hack.rb")} #{ENV["RUBYOPT"]}"
|
||||||
end
|
end
|
||||||
|
|
||||||
let(:code) { strip_whitespace(<<-RUBY) }
|
let(:code) { <<~RUBY }
|
||||||
require "pp"
|
require "pp"
|
||||||
loaded_specs = Gem.loaded_specs.dup
|
loaded_specs = Gem.loaded_specs.dup
|
||||||
#{exemptions.inspect}.each {|s| loaded_specs.delete(s) }
|
#{exemptions.inspect}.each {|s| loaded_specs.delete(s) }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue