diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2021-12-26 17:41:21 +0100 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2021-12-27 10:45:36 +0900 |
commit | ca3a2e46e8098bc66e2ab1589934bb40f00b78b1 (patch) | |
tree | d30c8f98818e912a312eb9f29b44c0fceb1459e9 /spec/bundler/commands/install_spec.rb | |
parent | 73707e5c51f9244f62dcaec044e50d7c604fc654 (diff) |
[rubygems/rubygems] Update some specs to pass ruby-head CI
These specs were monkeypatching `RUBY_VERSION`, but that obviously
doesn't change the running ruby to behave any different.
The removal of some features, in particular, `String#untaint`, made
these specs fail, because untaint is no longer available under ruby-core
and bundler calls `untaint` when `RUBY_VERSION` is less than "2.7",
which these specs were overwriting it to be.
Rewrite these specs to not overwrite `RUBY_VERSION`, but still test the
same things.
https://github.com/rubygems/rubygems/commit/e8c7b92901
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/5350
Diffstat (limited to 'spec/bundler/commands/install_spec.rb')
-rw-r--r-- | spec/bundler/commands/install_spec.rb | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/spec/bundler/commands/install_spec.rb b/spec/bundler/commands/install_spec.rb index e00caa5315..ec1d9bcd02 100644 --- a/spec/bundler/commands/install_spec.rb +++ b/spec/bundler/commands/install_spec.rb @@ -499,20 +499,17 @@ RSpec.describe "bundle install with gem sources" do context "and using an unsupported Ruby version" do it "prints an error" do install_gemfile <<-G, :raise_on_error => false - ::RUBY_VERSION = '2.0.1' - ruby '~> 2.2' + ruby '~> 1.2' source "#{file_uri_for(gem_repo1)}" G - expect(err).to include("Your Ruby version is 2.0.1, but your Gemfile specified ~> 2.2") + expect(err).to include("Your Ruby version is #{RUBY_VERSION}, but your Gemfile specified ~> 1.2") end end context "and using a supported Ruby version" do before do install_gemfile <<-G - ::RUBY_VERSION = '2.1.3' - ::RUBY_PATCHLEVEL = 100 - ruby '~> 2.1.0' + ruby '~> #{RUBY_VERSION}' source "#{file_uri_for(gem_repo1)}" G end @@ -529,18 +526,16 @@ RSpec.describe "bundle install with gem sources" do DEPENDENCIES RUBY VERSION - ruby 2.1.3p100 + #{Bundler::RubyVersion.system} BUNDLED WITH #{Bundler::VERSION} L end - it "updates Gemfile.lock with updated incompatible ruby version" do + it "updates Gemfile.lock with updated yet still compatible ruby version" do install_gemfile <<-G - ::RUBY_VERSION = '2.2.3' - ::RUBY_PATCHLEVEL = 100 - ruby '~> 2.2.0' + ruby '~> #{RUBY_VERSION[0..2]}' source "#{file_uri_for(gem_repo1)}" G @@ -555,7 +550,7 @@ RSpec.describe "bundle install with gem sources" do DEPENDENCIES RUBY VERSION - ruby 2.2.3p100 + #{Bundler::RubyVersion.system} BUNDLED WITH #{Bundler::VERSION} |