summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Graaff <graaff@gentoo.org>2021-03-08 12:09:17 +0100
committerHans de Graaff <graaff@gentoo.org>2021-03-08 12:09:30 +0100
commitfec067921d96e1e5b9d9a77c8715aabfe4778d8a (patch)
treec907b0ad6240647cc640ad9ca2bd0c44eb46de8b /dev-ruby/coderay
parentapp-crypt/heimdal: Stabilize 7.7.0-r1 x86, #762223 (diff)
downloadgentoo-fec067921d96e1e5b9d9a77c8715aabfe4778d8a.tar.gz
gentoo-fec067921d96e1e5b9d9a77c8715aabfe4778d8a.tar.bz2
gentoo-fec067921d96e1e5b9d9a77c8715aabfe4778d8a.zip
dev-ruby/coderay: fix tests with ruby30
Package-Manager: Portage-3.0.13, Repoman-3.0.2 Signed-off-by: Hans de Graaff <graaff@gentoo.org>
Diffstat (limited to 'dev-ruby/coderay')
-rw-r--r--dev-ruby/coderay/coderay-1.1.3-r1.ebuild4
-rw-r--r--dev-ruby/coderay/files/coderay-1.1.3-ruby30.patch51
2 files changed, 54 insertions, 1 deletions
diff --git a/dev-ruby/coderay/coderay-1.1.3-r1.ebuild b/dev-ruby/coderay/coderay-1.1.3-r1.ebuild
index d940e89b4842..7d653974d29e 100644
--- a/dev-ruby/coderay/coderay-1.1.3-r1.ebuild
+++ b/dev-ruby/coderay/coderay-1.1.3-r1.ebuild
@@ -3,7 +3,7 @@
EAPI=7
-USE_RUBY="ruby24 ruby25 ruby26 ruby27"
+USE_RUBY="ruby25 ruby26 ruby27"
# The test target also contains test:exe but that requires
# shoulda-context which we do not have packaged yet.
@@ -27,6 +27,8 @@ SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE=""
+PATCHES=("${FILESDIR}/${P}-ruby30.patch")
+
# Redcloth is an optional but automagically tested dependency. This
# requires redcloth-4.2.2. We don't depend on this version to make
# bootstrapping rspec with new versions easier, since redcloth depends
diff --git a/dev-ruby/coderay/files/coderay-1.1.3-ruby30.patch b/dev-ruby/coderay/files/coderay-1.1.3-ruby30.patch
new file mode 100644
index 000000000000..99ce3053a1d7
--- /dev/null
+++ b/dev-ruby/coderay/files/coderay-1.1.3-ruby30.patch
@@ -0,0 +1,51 @@
+From c1c15034749684fcad91ad2bcb2fcd2056faf18d Mon Sep 17 00:00:00 2001
+From: Mamoru TASAKA <mtasaka@fedoraproject.org>
+Date: Sun, 21 Feb 2021 23:04:03 +0900
+Subject: [PATCH] Fix test suite for ruby 3.0 change for methods on subclass of
+ Array
+
+With ruby 3.0, especially with https://github.com/ruby/ruby/pull/3690 ,
+for subclass of Array, `flatten` method now returns the instance of Array,
+not of the subclass.
+
+To keep the object instance of the subclass, use `flatten!` instead.
+---
+ test/unit/debug.rb | 3 ++-
+ test/unit/statistic.rb | 5 +++--
+ 2 files changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/test/unit/debug.rb b/test/unit/debug.rb
+index 88baf563..b694f21e 100644
+--- a/test/unit/debug.rb
++++ b/test/unit/debug.rb
+@@ -24,7 +24,8 @@ def test_creation
+ [" \n", :space],
+ ["[]", :method],
+ [:end_line, :head],
+- ].flatten
++ ]
++ TEST_INPUT.flatten!
+ TEST_OUTPUT = <<-'DEBUG'.chomp
+ integer(10)operator((\\\))string<content(test)>head[
+
+diff --git a/test/unit/statistic.rb b/test/unit/statistic.rb
+index 1326dca6..776774d4 100644
+--- a/test/unit/statistic.rb
++++ b/test/unit/statistic.rb
+@@ -24,7 +24,8 @@ def test_creation
+ [" \n", :space],
+ ["[]", :method],
+ [:end_line, :test],
+- ].flatten
++ ]
++ TEST_INPUT.flatten!
+ TEST_OUTPUT = <<-'DEBUG'
+
+ Code Statistics
+@@ -56,4 +57,4 @@ def test_filtering_text_tokens
+ assert_equal TEST_OUTPUT, TEST_INPUT.statistic
+ end
+
+-end
+\ No newline at end of file
++end