diff options
author | 2023-03-15 07:05:56 +0000 | |
---|---|---|
committer | 2023-03-18 00:01:46 +0000 | |
commit | 2e92b627546b1303b4a5c32828a4aa128c1ee976 (patch) | |
tree | 72696a42e69202c2c44601f7e40e696825d61aae /dev-ruby/mocha | |
parent | dev-ruby/introspection: add github upstream metadata (diff) | |
download | gentoo-2e92b627546b1303b4a5c32828a4aa128c1ee976.tar.gz gentoo-2e92b627546b1303b4a5c32828a4aa128c1ee976.tar.bz2 gentoo-2e92b627546b1303b4a5c32828a4aa128c1ee976.zip |
dev-ruby/mocha: enable ruby32
```
Finished in 0.156894s, 2676.9605 runs/s, 1791.0141 assertions/s.
420 runs, 281 assertions, 0 failures, 0 errors, 0 skips
```
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-ruby/mocha')
-rw-r--r-- | dev-ruby/mocha/files/mocha-2.0.2-ruby32.patch | 53 | ||||
-rw-r--r-- | dev-ruby/mocha/mocha-2.0.2.ebuild | 8 |
2 files changed, 59 insertions, 2 deletions
diff --git a/dev-ruby/mocha/files/mocha-2.0.2-ruby32.patch b/dev-ruby/mocha/files/mocha-2.0.2-ruby32.patch new file mode 100644 index 000000000000..a4f6b8c2fd7a --- /dev/null +++ b/dev-ruby/mocha/files/mocha-2.0.2-ruby32.patch @@ -0,0 +1,53 @@ +https://github.com/freerange/mocha/commit/ae9fed4a9f2ef6267302494ae0edf515d4a8a921 +https://github.com/freerange/mocha/commit/26b106a540ad57cd73401461451aa2711c541e9d + +From ae9fed4a9f2ef6267302494ae0edf515d4a8a921 Mon Sep 17 00:00:00 2001 +From: James Mead <james@floehopper.org> +Date: Thu, 24 Nov 2022 13:26:15 +0000 +Subject: [PATCH] DRY up regexp_matches test + +--- a/test/unit/parameter_matchers/regexp_matches_test.rb ++++ b/test/unit/parameter_matchers/regexp_matches_test.rb +@@ -32,14 +32,18 @@ def test_should_not_match_on_empty_arguments + end + + def test_should_not_raise_error_on_argument_that_does_not_respond_to_equals_tilde +- object_not_responding_to_equals_tilde = Class.new { undef =~ }.new + matcher = regexp_matches(/oo/) + assert_nothing_raised { matcher.matches?([object_not_responding_to_equals_tilde]) } + end + + def test_should_not_match_on_argument_that_does_not_respond_to_equals_tilde +- object_not_responding_to_equals_tilde = Class.new { undef =~ }.new + matcher = regexp_matches(/oo/) + assert !matcher.matches?([object_not_responding_to_equals_tilde]) + end ++ ++ private ++ ++ def object_not_responding_to_equals_tilde ++ Class.new { undef =~ }.new ++ end + end + +From 26b106a540ad57cd73401461451aa2711c541e9d Mon Sep 17 00:00:00 2001 +From: James Mead <james@floehopper.org> +Date: Fri, 25 Nov 2022 09:04:43 +0000 +Subject: [PATCH] Fix regexp_matches tests in Ruby v3.2 + +Object#~= has been removed from Ruby v3.2 [1]. + +Closes #590. + +[1]: https://bugs.ruby-lang.org/issues/15231 +--- a/test/unit/parameter_matchers/regexp_matches_test.rb ++++ b/test/unit/parameter_matchers/regexp_matches_test.rb +@@ -44,6 +44,6 @@ def test_should_not_match_on_argument_that_does_not_respond_to_equals_tilde + private + + def object_not_responding_to_equals_tilde +- Class.new { undef =~ }.new ++ Class.new { undef =~ if respond_to?(:=~) }.new + end + end + diff --git a/dev-ruby/mocha/mocha-2.0.2.ebuild b/dev-ruby/mocha/mocha-2.0.2.ebuild index 8b9904e74ec0..86f55e44e1b2 100644 --- a/dev-ruby/mocha/mocha-2.0.2.ebuild +++ b/dev-ruby/mocha/mocha-2.0.2.ebuild @@ -1,8 +1,8 @@ -# Copyright 1999-2022 Gentoo Authors +# Copyright 1999-2023 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 -USE_RUBY="ruby27 ruby30 ruby31" +USE_RUBY="ruby27 ruby30 ruby31 ruby32" RUBY_FAKEGEM_TASK_TEST="test:units test:acceptance" @@ -26,6 +26,10 @@ ruby_add_rdepend ">=dev-ruby/ruby2_keywords-0.0.5" ruby_add_bdepend " test? ( >=dev-ruby/test-unit-2.5.1-r1 dev-ruby/introspection )" +PATCHES=( + "${FILESDIR}"/${P}-ruby32.patch +) + all_ruby_prepare() { sed -i -e '/[Bb]undler/ s:^:#:' -e '1iload "lib/mocha/version.rb"' Rakefile || die |