mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[rubygems/rubygems] Remove the rest of the RUBY_VERSION
monkeypatching
Since we're at it. This generates a bunch of warnings and seems like a
brittle way to test things, so let's get rid of it.
f5d45520e0
This commit is contained in:
parent
ca3a2e46e8
commit
03903f23c2
Notes:
git
2021-12-27 10:46:03 +09:00
3 changed files with 24 additions and 19 deletions
|
@ -103,7 +103,7 @@ module Bundler
|
||||||
|
|
||||||
def self.system
|
def self.system
|
||||||
ruby_engine = RUBY_ENGINE.dup
|
ruby_engine = RUBY_ENGINE.dup
|
||||||
ruby_version = ENV.fetch("BUNDLER_SPEC_RUBY_VERSION") { RUBY_VERSION }.dup
|
ruby_version = RUBY_VERSION.dup
|
||||||
ruby_engine_version = RUBY_ENGINE_VERSION.dup
|
ruby_engine_version = RUBY_ENGINE_VERSION.dup
|
||||||
patchlevel = RUBY_PATCHLEVEL.to_s
|
patchlevel = RUBY_PATCHLEVEL.to_s
|
||||||
|
|
||||||
|
|
|
@ -46,18 +46,16 @@ RSpec.describe "ruby requirement" do
|
||||||
it "allows changing the ruby version requirement to something compatible" do
|
it "allows changing the ruby version requirement to something compatible" do
|
||||||
install_gemfile <<-G
|
install_gemfile <<-G
|
||||||
source "#{file_uri_for(gem_repo1)}"
|
source "#{file_uri_for(gem_repo1)}"
|
||||||
ruby ">= 1.0.0"
|
ruby ">= #{RUBY_VERSION[0..2]}.0"
|
||||||
gem "rack"
|
gem "rack"
|
||||||
G
|
G
|
||||||
|
|
||||||
allow(Bundler::SharedHelpers).to receive(:find_gemfile).and_return(bundled_app_gemfile)
|
allow(Bundler::SharedHelpers).to receive(:find_gemfile).and_return(bundled_app_gemfile)
|
||||||
expect(locked_ruby_version).to eq(Bundler::RubyVersion.system)
|
expect(locked_ruby_version).to eq(Bundler::RubyVersion.system)
|
||||||
|
|
||||||
simulate_ruby_version "5100"
|
|
||||||
|
|
||||||
install_gemfile <<-G
|
install_gemfile <<-G
|
||||||
source "#{file_uri_for(gem_repo1)}"
|
source "#{file_uri_for(gem_repo1)}"
|
||||||
ruby ">= 1.0.1"
|
ruby ">= #{RUBY_VERSION}"
|
||||||
gem "rack"
|
gem "rack"
|
||||||
G
|
G
|
||||||
|
|
||||||
|
@ -72,19 +70,35 @@ RSpec.describe "ruby requirement" do
|
||||||
gem "rack"
|
gem "rack"
|
||||||
G
|
G
|
||||||
|
|
||||||
allow(Bundler::SharedHelpers).to receive(:find_gemfile).and_return(bundled_app_gemfile)
|
lockfile <<~L
|
||||||
expect(locked_ruby_version).to eq(Bundler::RubyVersion.system)
|
GEM
|
||||||
|
remote: #{file_uri_for(gem_repo1)}/
|
||||||
|
specs:
|
||||||
|
rack (1.0.0)
|
||||||
|
|
||||||
simulate_ruby_version "5100"
|
PLATFORMS
|
||||||
|
#{lockfile_platforms}
|
||||||
|
|
||||||
|
DEPENDENCIES
|
||||||
|
rack
|
||||||
|
|
||||||
|
RUBY VERSION
|
||||||
|
ruby 2.1.4p422
|
||||||
|
|
||||||
|
BUNDLED WITH
|
||||||
|
#{Bundler::VERSION}
|
||||||
|
L
|
||||||
|
|
||||||
|
allow(Bundler::SharedHelpers).to receive(:find_gemfile).and_return(bundled_app_gemfile)
|
||||||
|
|
||||||
install_gemfile <<-G
|
install_gemfile <<-G
|
||||||
source "#{file_uri_for(gem_repo1)}"
|
source "#{file_uri_for(gem_repo1)}"
|
||||||
ruby ">= 5000.0"
|
ruby ">= #{RUBY_VERSION[0..2]}.0"
|
||||||
gem "rack"
|
gem "rack"
|
||||||
G
|
G
|
||||||
|
|
||||||
expect(the_bundle).to include_gems "rack 1.0.0"
|
expect(the_bundle).to include_gems "rack 1.0.0"
|
||||||
expect(locked_ruby_version.versions).to eq(["5100"])
|
expect(locked_ruby_version).to eq(Bundler::RubyVersion.system)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "allows requirements with trailing whitespace" do
|
it "allows requirements with trailing whitespace" do
|
||||||
|
|
|
@ -448,15 +448,6 @@ module Spec
|
||||||
ENV["BUNDLER_SPEC_PLATFORM"] = old if block_given?
|
ENV["BUNDLER_SPEC_PLATFORM"] = old if block_given?
|
||||||
end
|
end
|
||||||
|
|
||||||
def simulate_ruby_version(version)
|
|
||||||
return if version == RUBY_VERSION
|
|
||||||
old = ENV["BUNDLER_SPEC_RUBY_VERSION"]
|
|
||||||
ENV["BUNDLER_SPEC_RUBY_VERSION"] = version
|
|
||||||
yield if block_given?
|
|
||||||
ensure
|
|
||||||
ENV["BUNDLER_SPEC_RUBY_VERSION"] = old if block_given?
|
|
||||||
end
|
|
||||||
|
|
||||||
def simulate_windows(platform = mswin)
|
def simulate_windows(platform = mswin)
|
||||||
simulate_platform platform do
|
simulate_platform platform do
|
||||||
simulate_bundler_version_when_missing_prerelease_default_gem_activation do
|
simulate_bundler_version_when_missing_prerelease_default_gem_activation do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue