You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
rubygem-mocha/SOURCES/rubygem-mocha-2.0.2-dry-up-...

35 lines
1.3 KiB

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
---
test/unit/parameter_matchers/regexp_matches_test.rb | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/test/unit/parameter_matchers/regexp_matches_test.rb b/test/unit/parameter_matchers/regexp_matches_test.rb
index e0282c859..058baaccd 100644
--- 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