From 261f8023842b6f90007df68dfc3d88a01a9337a2 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Thu, 27 Feb 2025 15:49:28 +0900 Subject: [PATCH] Move irb detection to top-level before(:each) block --- spec/bundler/commands/platform_spec.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/spec/bundler/commands/platform_spec.rb b/spec/bundler/commands/platform_spec.rb index 7f740e305b..174ee239b7 100644 --- a/spec/bundler/commands/platform_spec.rb +++ b/spec/bundler/commands/platform_spec.rb @@ -941,6 +941,12 @@ G context "bundle console", bundler: "< 3" do before do + begin + require "irb" + rescue LoadError + skip "This spec requires IRB to be available" + end + install_gemfile <<-G source "https://gem.repo1" gem "myrack" @@ -950,12 +956,6 @@ G end it "starts IRB with the default group loaded when ruby version matches", :readline do - begin - require "irb" - rescue LoadError - skip "This spec requires IRB to be available" - end - gemfile <<-G source "https://gem.repo1" gem "myrack"