From 801284c14af3a9a93db29e7126b8d66b4fba1788 Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Sun, 17 Dec 2023 10:46:31 +0100 Subject: [PATCH] Require readline-ext when testing with Ruby 3.3 In ruby 3.3, requiring readline does not load the real readline library but falls back to reline by default. This creates odd output when the terminal is not a real TTY, making the interactive debugging scenario fail. See https://github.com/cucumber/aruba/issues/910 for details. Also, see https://github.com/ruby/reline/issues/616 for the resulting reline issue. As a workaround, add the readline-ext gem which tries to use the real readline as was the default in Ruby 3.2 and earlier. --- Appraisals | 6 ++++++ Gemfile | 3 +++ gemfiles/cucumber_8.gemfile | 1 + gemfiles/cucumber_9.gemfile | 1 + 4 files changed, 11 insertions(+) diff --git a/Appraisals b/Appraisals index 335661926..ae85eed62 100644 --- a/Appraisals +++ b/Appraisals @@ -2,8 +2,14 @@ appraise "cucumber_8" do gem "cucumber", "~> 8.0" + + # Work-around for https://github.com/ruby/reline/issues/616 in Ruby 3.3 + gem "readline-ext", "~> 0.2.0", platforms: :mri_33 end appraise "cucumber_9" do gem "cucumber", ["~> 9.0", ">= 9.0.1"] + + # Work-around for https://github.com/ruby/reline/issues/616 in Ruby 3.3 + gem "readline-ext", "~> 0.2.0", platforms: :mri_33 end diff --git a/Gemfile b/Gemfile index 3c7cea132..50bce2cb7 100644 --- a/Gemfile +++ b/Gemfile @@ -3,6 +3,9 @@ source "https://rubygems.org" # Use dependencies from gemspec gemspec +# Work-around for https://github.com/ruby/reline/issues/616 in Ruby 3.3 +gem "readline-ext", "~> 0.2.0", platforms: :mri_33 + # Load local Gemfile if File.file? File.expand_path("Gemfile.local", __dir__) load File.expand_path("Gemfile.local", __dir__) diff --git a/gemfiles/cucumber_8.gemfile b/gemfiles/cucumber_8.gemfile index b8f54b2d6..7e6e96b78 100644 --- a/gemfiles/cucumber_8.gemfile +++ b/gemfiles/cucumber_8.gemfile @@ -2,6 +2,7 @@ source "https://rubygems.org" +gem "readline-ext", "~> 0.2.0", platforms: :mri_33 gem "cucumber", "~> 8.0" gemspec path: "../" diff --git a/gemfiles/cucumber_9.gemfile b/gemfiles/cucumber_9.gemfile index 37a55d72e..984f5c731 100644 --- a/gemfiles/cucumber_9.gemfile +++ b/gemfiles/cucumber_9.gemfile @@ -2,6 +2,7 @@ source "https://rubygems.org" +gem "readline-ext", "~> 0.2.0", platforms: :mri_33 gem "cucumber", ["~> 9.0", ">= 9.0.1"] gemspec path: "../"