diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2023-03-13 18:57:38 +0100 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2023-03-17 18:50:55 +0900 |
commit | d5121992dc50112e0ebae84b993a957fdcdcff45 (patch) | |
tree | bc316ed5ab8ac5c349fa80f47c1092f250145df2 /spec | |
parent | 2d8b55fcd2cf816f4548ca7be48ba74b2cb0e05e (diff) | |
download | ruby-d5121992dc50112e0ebae84b993a957fdcdcff45.tar.gz |
[rubygems/rubygems] Remove unnecessary `specific_local_platform` test helper
https://github.com/rubygems/rubygems/commit/86b574824d
Diffstat (limited to 'spec')
-rw-r--r-- | spec/bundler/commands/check_spec.rb | 2 | ||||
-rw-r--r-- | spec/bundler/commands/lock_spec.rb | 10 | ||||
-rw-r--r-- | spec/bundler/commands/outdated_spec.rb | 2 | ||||
-rw-r--r-- | spec/bundler/commands/platform_spec.rb | 8 | ||||
-rw-r--r-- | spec/bundler/commands/update_spec.rb | 8 | ||||
-rw-r--r-- | spec/bundler/install/gemfile/platform_spec.rb | 2 | ||||
-rw-r--r-- | spec/bundler/install/gemfile/sources_spec.rb | 28 | ||||
-rw-r--r-- | spec/bundler/install/global_cache_spec.rb | 4 | ||||
-rw-r--r-- | spec/bundler/support/platforms.rb | 6 |
9 files changed, 33 insertions, 37 deletions
diff --git a/spec/bundler/commands/check_spec.rb b/spec/bundler/commands/check_spec.rb index 1200ce848c..99a858e9e9 100644 --- a/spec/bundler/commands/check_spec.rb +++ b/spec/bundler/commands/check_spec.rb @@ -351,7 +351,7 @@ RSpec.describe "bundle check" do PLATFORMS ruby - #{specific_local_platform} + #{local_platform} DEPENDENCIES rack diff --git a/spec/bundler/commands/lock_spec.rb b/spec/bundler/commands/lock_spec.rb index 7ffffbffc2..8663cda643 100644 --- a/spec/bundler/commands/lock_spec.rb +++ b/spec/bundler/commands/lock_spec.rb @@ -266,7 +266,7 @@ RSpec.describe "bundle lock" do allow(Bundler::SharedHelpers).to receive(:find_gemfile).and_return(bundled_app_gemfile) lockfile = Bundler::LockfileParser.new(read_lockfile) - expect(lockfile.platforms).to match_array([java, x86_mingw32, specific_local_platform].uniq) + expect(lockfile.platforms).to match_array([java, x86_mingw32, local_platform].uniq) end it "supports adding new platforms with force_ruby_platform = true" do @@ -298,7 +298,7 @@ RSpec.describe "bundle lock" do allow(Bundler::SharedHelpers).to receive(:find_gemfile).and_return(bundled_app_gemfile) lockfile = Bundler::LockfileParser.new(read_lockfile) - expect(lockfile.platforms).to match_array(["ruby", specific_local_platform].uniq) + expect(lockfile.platforms).to match_array(["ruby", local_platform].uniq) end it "warns when adding an unknown platform" do @@ -311,12 +311,12 @@ RSpec.describe "bundle lock" do allow(Bundler::SharedHelpers).to receive(:find_gemfile).and_return(bundled_app_gemfile) lockfile = Bundler::LockfileParser.new(read_lockfile) - expect(lockfile.platforms).to match_array([java, x86_mingw32, specific_local_platform].uniq) + expect(lockfile.platforms).to match_array([java, x86_mingw32, local_platform].uniq) bundle "lock --remove-platform java" lockfile = Bundler::LockfileParser.new(read_lockfile) - expect(lockfile.platforms).to match_array([x86_mingw32, specific_local_platform].uniq) + expect(lockfile.platforms).to match_array([x86_mingw32, local_platform].uniq) end it "also cleans up redundant platform gems when removing platforms" do @@ -375,7 +375,7 @@ RSpec.describe "bundle lock" do end it "errors when removing all platforms" do - bundle "lock --remove-platform #{specific_local_platform}", :raise_on_error => false + bundle "lock --remove-platform #{local_platform}", :raise_on_error => false expect(err).to include("Removing all platforms from the bundle is not allowed") end diff --git a/spec/bundler/commands/outdated_spec.rb b/spec/bundler/commands/outdated_spec.rb index e084af85d7..bbc3cb54ae 100644 --- a/spec/bundler/commands/outdated_spec.rb +++ b/spec/bundler/commands/outdated_spec.rb @@ -192,7 +192,7 @@ RSpec.describe "bundle outdated" do vcr (6.0.0) PLATFORMS - #{specific_local_platform} + #{local_platform} DEPENDENCIES dotenv diff --git a/spec/bundler/commands/platform_spec.rb b/spec/bundler/commands/platform_spec.rb index 4e8e3946fe..688bf7b6df 100644 --- a/spec/bundler/commands/platform_spec.rb +++ b/spec/bundler/commands/platform_spec.rb @@ -16,7 +16,7 @@ RSpec.describe "bundle platform" do Your platform is: #{Gem::Platform.local} Your app has gems that work on these platforms: -* #{specific_local_platform} +* #{local_platform} Your Gemfile specifies a Ruby version requirement: * ruby #{Gem.ruby_version} @@ -39,7 +39,7 @@ G Your platform is: #{Gem::Platform.local} Your app has gems that work on these platforms: -* #{specific_local_platform} +* #{local_platform} Your Gemfile specifies a Ruby version requirement: * #{Bundler::RubyVersion.system.single_version_string} @@ -60,7 +60,7 @@ G Your platform is: #{Gem::Platform.local} Your app has gems that work on these platforms: -* #{specific_local_platform} +* #{local_platform} Your Gemfile does not specify a Ruby version requirement. G @@ -80,7 +80,7 @@ G Your platform is: #{Gem::Platform.local} Your app has gems that work on these platforms: -* #{specific_local_platform} +* #{local_platform} Your Gemfile specifies a Ruby version requirement: * ruby #{not_local_ruby_version} diff --git a/spec/bundler/commands/update_spec.rb b/spec/bundler/commands/update_spec.rb index 8c7b9c13c8..7016c3e19f 100644 --- a/spec/bundler/commands/update_spec.rb +++ b/spec/bundler/commands/update_spec.rb @@ -284,7 +284,7 @@ RSpec.describe "bundle update" do countries (~> 3.0) PLATFORMS - #{specific_local_platform} + #{local_platform} DEPENDENCIES countries @@ -871,7 +871,7 @@ RSpec.describe "bundle update" do vcr (6.0.0) PLATFORMS - #{specific_local_platform} + #{local_platform} DEPENDENCIES dotenv @@ -1602,7 +1602,7 @@ RSpec.describe "bundle update conservative" do shared_dep (~> 5.0) PLATFORMS - #{specific_local_platform} + #{local_platform} DEPENDENCIES isolated_owner @@ -1655,7 +1655,7 @@ RSpec.describe "bundle update conservative" do shared_dep (~> 5.0) PLATFORMS - #{specific_local_platform} + #{local_platform} DEPENDENCIES isolated_owner diff --git a/spec/bundler/install/gemfile/platform_spec.rb b/spec/bundler/install/gemfile/platform_spec.rb index 624de6455d..d28c7b781f 100644 --- a/spec/bundler/install/gemfile/platform_spec.rb +++ b/spec/bundler/install/gemfile/platform_spec.rb @@ -459,7 +459,7 @@ RSpec.describe "bundle install with platform conditionals" do tzinfo (2.0.4) PLATFORMS - #{specific_local_platform} + #{local_platform} DEPENDENCIES activesupport diff --git a/spec/bundler/install/gemfile/sources_spec.rb b/spec/bundler/install/gemfile/sources_spec.rb index 7189967d29..562fa6c5b4 100644 --- a/spec/bundler/install/gemfile/sources_spec.rb +++ b/spec/bundler/install/gemfile/sources_spec.rb @@ -262,7 +262,7 @@ RSpec.describe "bundle install with gems on multiple sources" do rack PLATFORMS - #{specific_local_platform} + #{local_platform} DEPENDENCIES depends_on_rack! @@ -640,7 +640,7 @@ RSpec.describe "bundle install with gems on multiple sources" do zeitwerk (2.4.2) PLATFORMS - #{specific_local_platform} + #{local_platform} DEPENDENCIES activesupport @@ -696,7 +696,7 @@ RSpec.describe "bundle install with gems on multiple sources" do sidekiq (>= 6.1.0) PLATFORMS - #{specific_local_platform} + #{local_platform} DEPENDENCIES activesupport @@ -780,7 +780,7 @@ RSpec.describe "bundle install with gems on multiple sources" do sidekiq (>= 6.1.0) PLATFORMS - #{specific_local_platform} + #{local_platform} DEPENDENCIES activesupport @@ -836,7 +836,7 @@ RSpec.describe "bundle install with gems on multiple sources" do sidekiq (>= 6.1.0) PLATFORMS - #{specific_local_platform} + #{local_platform} DEPENDENCIES activesupport @@ -924,7 +924,7 @@ RSpec.describe "bundle install with gems on multiple sources" do nokogiri (>= 1.2.3) PLATFORMS - #{specific_local_platform} + #{local_platform} DEPENDENCIES handsoap! @@ -984,7 +984,7 @@ RSpec.describe "bundle install with gems on multiple sources" do rack (0.9.1) PLATFORMS - #{specific_local_platform} + #{local_platform} DEPENDENCIES rack! @@ -1014,7 +1014,7 @@ RSpec.describe "bundle install with gems on multiple sources" do rack (0.9.1) PLATFORMS - #{specific_local_platform} + #{local_platform} DEPENDENCIES rack! @@ -1036,7 +1036,7 @@ RSpec.describe "bundle install with gems on multiple sources" do rack (0.9.1) PLATFORMS - #{specific_local_platform} + #{local_platform} DEPENDENCIES rack! @@ -1448,7 +1448,7 @@ RSpec.describe "bundle install with gems on multiple sources" do mime-types (3.3.1) PLATFORMS - #{specific_local_platform} + #{local_platform} DEPENDENCIES capybara (~> 2.5.0) @@ -1472,7 +1472,7 @@ RSpec.describe "bundle install with gems on multiple sources" do mime-types (3.0.0) PLATFORMS - #{specific_local_platform} + #{local_platform} DEPENDENCIES capybara (~> 2.5.0) @@ -1526,7 +1526,7 @@ RSpec.describe "bundle install with gems on multiple sources" do pdf-writer (= 1.1.8) PLATFORMS - #{specific_local_platform} + #{local_platform} DEPENDENCIES ruport (= 1.7.0.3)! @@ -1579,7 +1579,7 @@ RSpec.describe "bundle install with gems on multiple sources" do pdf-writer (= 1.1.8) PLATFORMS - #{specific_local_platform} + #{local_platform} DEPENDENCIES ruport (= 1.7.0.3)! @@ -1620,7 +1620,7 @@ RSpec.describe "bundle install with gems on multiple sources" do pdf-writer (1.1.8) PLATFORMS - #{specific_local_platform} + #{local_platform} DEPENDENCIES pdf-writer (= 1.1.8) diff --git a/spec/bundler/install/global_cache_spec.rb b/spec/bundler/install/global_cache_spec.rb index 3021d6ae17..be34d8b5bc 100644 --- a/spec/bundler/install/global_cache_spec.rb +++ b/spec/bundler/install/global_cache_spec.rb @@ -220,9 +220,9 @@ RSpec.describe "global gem caching" do gem "very_simple_path_binary", :path => "#{lib_path("very_simple_path_binary-1.0")}" G - gem_binary_cache = home(".bundle", "cache", "extensions", specific_local_platform.to_s, Bundler.ruby_scope, + gem_binary_cache = home(".bundle", "cache", "extensions", local_platform.to_s, Bundler.ruby_scope, Digest(:MD5).hexdigest("#{gem_repo1}/"), "very_simple_binary-1.0") - git_binary_cache = home(".bundle", "cache", "extensions", specific_local_platform.to_s, Bundler.ruby_scope, + git_binary_cache = home(".bundle", "cache", "extensions", local_platform.to_s, Bundler.ruby_scope, "very_simple_git_binary-1.0-#{revision}", "very_simple_git_binary-1.0") cached_extensions = Pathname.glob(home(".bundle", "cache", "extensions", "*", "*", "*", "*", "*")).sort diff --git a/spec/bundler/support/platforms.rb b/spec/bundler/support/platforms.rb index 3cc28e0a61..89a8d45ffd 100644 --- a/spec/bundler/support/platforms.rb +++ b/spec/bundler/support/platforms.rb @@ -52,10 +52,6 @@ module Spec [rb, java, linux, windows_platforms].flatten end - def specific_local_platform - Bundler.local_platform - end - def not_local all_platforms.find {|p| p != generic_local_platform } end @@ -100,7 +96,7 @@ module Spec end def lockfile_platforms(*extra) - [specific_local_platform, *extra].map(&:to_s).sort.join("\n ") + [local_platform, *extra].map(&:to_s).sort.join("\n ") end end end |