From 9d5a3c0314f8065ab8da54e82cfaebe5f538883a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Thu, 6 Mar 2025 19:44:48 +0100 Subject: [PATCH] [rubygems/rubygems] Reduce duplicate of some spec gemfiles https://github.com/rubygems/rubygems/commit/bd42c840c6 --- spec/bundler/commands/platform_spec.rb | 54 +++----------------------- 1 file changed, 6 insertions(+), 48 deletions(-) diff --git a/spec/bundler/commands/platform_spec.rb b/spec/bundler/commands/platform_spec.rb index 6e0a02bcf0..ab69ea0de8 100644 --- a/spec/bundler/commands/platform_spec.rb +++ b/spec/bundler/commands/platform_spec.rb @@ -950,14 +950,7 @@ G end it "starts IRB with the default group loaded when ruby version matches", :readline do - gemfile <<-G - source "https://gem.repo1" - gem "myrack" - gem "activesupport", :group => :test - gem "myrack_middleware", :group => :development - - #{ruby_version_correct} - G + gemfile gemfile + "\n\n#{ruby_version_correct}\n" bundle "console" do |input, _, _| input.puts("puts MYRACK") @@ -967,14 +960,7 @@ G end it "starts IRB with the default group loaded when ruby version matches", :readline, :jruby_only do - gemfile <<-G - source "https://gem.repo1" - gem "myrack" - gem "activesupport", :group => :test - gem "myrack_middleware", :group => :development - - #{ruby_version_correct_engineless} - G + gemfile gemfile + "\n\n#{ruby_version_correct_engineless}\n" bundle "console" do |input, _, _| input.puts("puts MYRACK") @@ -984,56 +970,28 @@ G end it "fails when ruby version doesn't match" do - gemfile <<-G - source "https://gem.repo1" - gem "myrack" - gem "activesupport", :group => :test - gem "myrack_middleware", :group => :development - - #{ruby_version_incorrect} - G + gemfile gemfile + "\n\n#{ruby_version_incorrect}\n" bundle "console", raise_on_error: false should_be_ruby_version_incorrect end it "fails when engine doesn't match" do - gemfile <<-G - source "https://gem.repo1" - gem "myrack" - gem "activesupport", :group => :test - gem "myrack_middleware", :group => :development - - #{engine_incorrect} - G + gemfile gemfile + "\n\n#{engine_incorrect}\n" bundle "console", raise_on_error: false should_be_engine_incorrect end it "fails when engine version doesn't match", :jruby_only do - gemfile <<-G - source "https://gem.repo1" - gem "myrack" - gem "activesupport", :group => :test - gem "myrack_middleware", :group => :development - - #{engine_version_incorrect} - G + gemfile gemfile + "\n\n#{engine_version_incorrect}\n" bundle "console", raise_on_error: false should_be_engine_version_incorrect end it "fails when patchlevel doesn't match" do - gemfile <<-G - source "https://gem.repo1" - gem "myrack" - gem "activesupport", :group => :test - gem "myrack_middleware", :group => :development - - #{patchlevel_incorrect} - G + gemfile gemfile + "\n\n#{patchlevel_incorrect}\n" bundle "console", raise_on_error: false should_be_patchlevel_incorrect