Use erb executable instead of irb
This commit is contained in:
parent
48b6c60969
commit
3e8bf097ce
Notes:
git
2025-02-27 06:48:43 +00:00
@ -193,82 +193,74 @@ RSpec.describe "bundle exec" do
|
|||||||
end
|
end
|
||||||
|
|
||||||
context "with default gems" do
|
context "with default gems" do
|
||||||
before do
|
let(:default_erb_version) { ruby "gem 'erb', '< 999999'; require 'erb'; puts ERB.const_get(:VERSION)", raise_on_error: false }
|
||||||
begin
|
|
||||||
require "irb"
|
|
||||||
rescue LoadError
|
|
||||||
skip "This spec requires IRB to be available"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
let(:default_irb_version) { ruby "gem 'irb', '< 999999'; require 'irb'; puts IRB::VERSION", raise_on_error: false }
|
|
||||||
|
|
||||||
context "when not specified in Gemfile" do
|
context "when not specified in Gemfile" do
|
||||||
before do
|
before do
|
||||||
skip "irb isn't a default gem" if default_irb_version.empty?
|
skip "erb isn't a default gem" if default_erb_version.empty?
|
||||||
|
|
||||||
install_gemfile "source \"https://gem.repo1\""
|
install_gemfile "source \"https://gem.repo1\""
|
||||||
end
|
end
|
||||||
|
|
||||||
it "uses version provided by ruby" do
|
it "uses version provided by ruby" do
|
||||||
bundle "exec irb --version"
|
bundle "exec erb --version"
|
||||||
|
|
||||||
expect(out).to include(default_irb_version)
|
expect(out).to include(default_erb_version)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "when specified in Gemfile directly" do
|
context "when specified in Gemfile directly" do
|
||||||
let(:specified_irb_version) { "0.9.6" }
|
let(:specified_erb_version) { "2.2.3" }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
skip "irb isn't a default gem" if default_irb_version.empty?
|
skip "erb isn't a default gem" if default_erb_version.empty?
|
||||||
|
|
||||||
build_repo2 do
|
build_repo2 do
|
||||||
build_gem "irb", specified_irb_version do |s|
|
build_gem "erb", specified_erb_version do |s|
|
||||||
s.executables = "irb"
|
s.executables = "erb"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
install_gemfile <<-G
|
install_gemfile <<-G
|
||||||
source "https://gem.repo2"
|
source "https://gem.repo2"
|
||||||
gem "irb", "#{specified_irb_version}"
|
gem "erb", "#{specified_erb_version}"
|
||||||
G
|
G
|
||||||
end
|
end
|
||||||
|
|
||||||
it "uses version specified" do
|
it "uses version specified" do
|
||||||
bundle "exec irb --version"
|
bundle "exec erb --version"
|
||||||
|
|
||||||
expect(out).to eq(specified_irb_version)
|
expect(out).to eq(specified_erb_version)
|
||||||
expect(err).to be_empty
|
expect(err).to be_empty
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "when specified in Gemfile indirectly" do
|
context "when specified in Gemfile indirectly" do
|
||||||
let(:indirect_irb_version) { "0.9.6" }
|
let(:indirect_erb_version) { "2.2.3" }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
skip "irb isn't a default gem" if default_irb_version.empty?
|
skip "erb isn't a default gem" if default_erb_version.empty?
|
||||||
|
|
||||||
build_repo2 do
|
build_repo2 do
|
||||||
build_gem "irb", indirect_irb_version do |s|
|
build_gem "erb", indirect_erb_version do |s|
|
||||||
s.executables = "irb"
|
s.executables = "erb"
|
||||||
end
|
end
|
||||||
|
|
||||||
build_gem "gem_depending_on_old_irb" do |s|
|
build_gem "gem_depending_on_old_erb" do |s|
|
||||||
s.add_dependency "irb", indirect_irb_version
|
s.add_dependency "erb", indirect_erb_version
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
install_gemfile <<-G
|
install_gemfile <<-G
|
||||||
source "https://gem.repo2"
|
source "https://gem.repo2"
|
||||||
gem "gem_depending_on_old_irb"
|
gem "gem_depending_on_old_erb"
|
||||||
G
|
G
|
||||||
|
|
||||||
bundle "exec irb --version"
|
bundle "exec erb --version"
|
||||||
end
|
end
|
||||||
|
|
||||||
it "uses resolved version" do
|
it "uses resolved version" do
|
||||||
expect(out).to eq(indirect_irb_version)
|
expect(out).to eq(indirect_erb_version)
|
||||||
expect(err).to be_empty
|
expect(err).to be_empty
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -645,12 +637,6 @@ RSpec.describe "bundle exec" do
|
|||||||
|
|
||||||
describe "with gems bundled via :path with invalid gemspecs" do
|
describe "with gems bundled via :path with invalid gemspecs" do
|
||||||
it "outputs the gemspec validation errors" do
|
it "outputs the gemspec validation errors" do
|
||||||
begin
|
|
||||||
require "irb"
|
|
||||||
rescue LoadError
|
|
||||||
skip "This spec requires IRB to be available"
|
|
||||||
end
|
|
||||||
|
|
||||||
build_lib "foo"
|
build_lib "foo"
|
||||||
|
|
||||||
gemspec = lib_path("foo-1.0").join("foo.gemspec").to_s
|
gemspec = lib_path("foo-1.0").join("foo.gemspec").to_s
|
||||||
@ -671,7 +657,7 @@ RSpec.describe "bundle exec" do
|
|||||||
gem "foo", :path => "#{lib_path("foo-1.0")}"
|
gem "foo", :path => "#{lib_path("foo-1.0")}"
|
||||||
G
|
G
|
||||||
|
|
||||||
bundle "exec irb", raise_on_error: false
|
bundle "exec erb", raise_on_error: false
|
||||||
|
|
||||||
expect(err).to match("The gemspec at #{lib_path("foo-1.0").join("foo.gemspec")} is not valid")
|
expect(err).to match("The gemspec at #{lib_path("foo-1.0").join("foo.gemspec")} is not valid")
|
||||||
expect(err).to match(/missing value for attribute rubygems_version|rubygems_version must not be nil/)
|
expect(err).to match(/missing value for attribute rubygems_version|rubygems_version must not be nil/)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user