commit: 557922daa276be471bff9f1fbfc9e4ee3fbbe6c9
Author: Sam James gentoo org>
AuthorDate: Wed Mar 15 07:37:12 2023 +
Commit: Sam James gentoo org>
CommitDate: Sat Mar 18 00:02:01 2023 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=557922da
dev-ruby/thor: enable ruby32
```
Finished in 0.6724 seconds (files took 0.35272 seconds to load)
800 examples, 0 failures, 1 pending
```
Signed-off-by: Sam James gentoo.org>
dev-ruby/thor/files/thor-1.2.1-tests.patch | 211 +
dev-ruby/thor/thor-1.2.1-r1.ebuild | 74 ++
2 files changed, 285 insertions(+)
diff --git a/dev-ruby/thor/files/thor-1.2.1-tests.patch
b/dev-ruby/thor/files/thor-1.2.1-tests.patch
new file mode 100644
index ..bd59deda2338
--- /dev/null
+++ b/dev-ruby/thor/files/thor-1.2.1-tests.patch
@@ -0,0 +1,211 @@
+https://github.com/rails/thor/issues/817
+https://github.com/rails/thor/commit/0def4cfba5bf470f76877eb3b8a8895f0018e574
+https://github.com/rails/thor/commit/46d1422902e1c66b31fae79be7dca79ff8b2e81b
+
+From 0def4cfba5bf470f76877eb3b8a8895f0018e574 Mon Sep 17 00:00:00 2001
+From: Tim Diggins
+Date: Fri, 4 Mar 2022 12:16:58 +
+Subject: [PATCH] fix expectations for ruby 3 treatment of hash arg
+
+--- a/spec/line_editor_spec.rb
b/spec/line_editor_spec.rb
+@@ -13,7 +13,7 @@
+ describe ".readline" do
+ it "uses the Readline line editor" do
+ editor = double("Readline")
+- expect(Thor::LineEditor::Readline).to receive(:new).with("Enter your
name ", :default => "Brian").and_return(editor)
++ expect(Thor::LineEditor::Readline).to receive(:new).with("Enter your
name ", {:default => "Brian"}).and_return(editor)
+ expect(editor).to receive(:readline).and_return("George")
+ expect(Thor::LineEditor.readline("Enter your name ", :default =>
"Brian")).to eq("George")
+ end
+@@ -35,7 +35,7 @@
+ describe ".readline" do
+ it "uses the Basic line editor" do
+ editor = double("Basic")
+- expect(Thor::LineEditor::Basic).to receive(:new).with("Enter your name
", :default => "Brian").and_return(editor)
++ expect(Thor::LineEditor::Basic).to receive(:new).with("Enter your name
", {:default => "Brian"}).and_return(editor)
+ expect(editor).to receive(:readline).and_return("George")
+ expect(Thor::LineEditor.readline("Enter your name ", :default =>
"Brian")).to eq("George")
+ end
+--- a/spec/shell/basic_spec.rb
b/spec/shell/basic_spec.rb
+@@ -70,80 +70,80 @@ def shell
+
+ it "prints a message to the user with the available options, expects
case-sensitive matching, and determines the correctness of the answer" do
+ flavors = %w(strawberry chocolate vanilla)
+- expect(Thor::LineEditor).to receive(:readline).with('What\'s your
favorite Neopolitan flavor? [strawberry, chocolate, vanilla] ', :limited_to =>
flavors).and_return("chocolate")
++ expect(Thor::LineEditor).to receive(:readline).with('What\'s your
favorite Neopolitan flavor? [strawberry, chocolate, vanilla] ', {:limited_to =>
flavors}).and_return("chocolate")
+ expect(shell.ask('What\'s your favorite Neopolitan flavor?',
:limited_to => flavors)).to eq("chocolate")
+ end
+
+ it "prints a message to the user with the available options, expects
case-sensitive matching, and reasks the question after an incorrect response" do
+ flavors = %w(strawberry chocolate vanilla)
+ expect($stdout).to receive(:print).with("Your response must be one of:
[strawberry, chocolate, vanilla]. Please try again.\n")
+- expect(Thor::LineEditor).to receive(:readline).with('What\'s your
favorite Neopolitan flavor? [strawberry, chocolate, vanilla] ', :limited_to =>
flavors).and_return("moose tracks", "chocolate")
++ expect(Thor::LineEditor).to receive(:readline).with('What\'s your
favorite Neopolitan flavor? [strawberry, chocolate, vanilla] ', {:limited_to =>
flavors}).and_return("moose tracks", "chocolate")
+ expect(shell.ask('What\'s your favorite Neopolitan flavor?',
:limited_to => flavors)).to eq("chocolate")
+ end
+
+ it "prints a message to the user with the available options, expects
case-sensitive matching, and reasks the question after a case-insensitive
match" do
+ flavors = %w(strawberry chocolate vanilla)
+ expect($stdout).to receive(:print).with("Your response must be one of:
[strawberry, chocolate, vanilla]. Please try again.\n")
+- expect(Thor::LineEditor).to receive(:readline).with('What\'s your
favorite Neopolitan flavor? [strawberry, chocolate, vanilla] ', :limited_to =>
flavors).and_return("cHoCoLaTe", "chocolate")
++ expect(Thor::LineEditor).to receive(:readline).with('What\'s your
favorite Neopolitan flavor? [strawberry, chocolate, vanilla] ', {:limited_to =>
flavors}).and_return("cHoCoLaTe", "chocolate")
+ expect(shell.ask('What\'s your favorite Neopolitan flavor?',
:limited_to => flavors)).to eq("chocolate")