Git Product home page Git Product logo

Comments (5)

mtasaka avatar mtasaka commented on June 25, 2024

Quick fix is:

diff --git a/test/unit/parameter_matchers/regexp_matches_test.rb b/test/unit/parameter_matchers/regexp_matches_test.rb
index e0282c8..9251054 100644
--- a/test/unit/parameter_matchers/regexp_matches_test.rb
+++ b/test/unit/parameter_matchers/regexp_matches_test.rb
@@ -32,13 +32,13 @@ class RegexpMatchesTest < Mocha::TestCase
   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
+    object_not_responding_to_equals_tilde = Class.new { undef =~ if respond_to?(:=~) }.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
+    object_not_responding_to_equals_tilde = Class.new { undef =~ if respond_to?(:=~) }.new
     matcher = regexp_matches(/oo/)
     assert !matcher.matches?([object_not_responding_to_equals_tilde])
   end

from mocha.

floehopper avatar floehopper commented on June 25, 2024

@mtasaka Thanks for reporting this. I will apply the patch you have suggested as soon as I have time.

from mocha.

floehopper avatar floehopper commented on June 25, 2024

Note to self: the change is explained in more detail here.

from mocha.

floehopper avatar floehopper commented on June 25, 2024

@mtasaka Sorry this took a while - I was unable to install Ruby v3.2.0-preview3 locally due to this issue. However, fortunately that version is available in CircleCI builds.

from mocha.

floehopper avatar floehopper commented on June 25, 2024

The fix for this was released in v2.0.3.

from mocha.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.