Skip to content

Commit

Permalink
Require readline-ext when testing with Ruby 3.3
Browse files Browse the repository at this point in the history
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 #910 for details. Also, see
ruby/reline#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.
  • Loading branch information
mvz committed Dec 23, 2023
1 parent aa2114b commit 801284c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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__)
Expand Down
1 change: 1 addition & 0 deletions gemfiles/cucumber_8.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

source "https://rubygems.org"

gem "readline-ext", "~> 0.2.0", platforms: :mri_33
gem "cucumber", "~> 8.0"

gemspec path: "../"
1 change: 1 addition & 0 deletions gemfiles/cucumber_9.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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: "../"

0 comments on commit 801284c

Please sign in to comment.