We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 880bcb9 commit 4ea4bf7Copy full SHA for 4ea4bf7
lib/mspec/matchers/raise_error.rb
@@ -90,4 +90,15 @@ module MSpecMatchers
90
private def raise_error(exception = Exception, message = nil, &block)
91
RaiseErrorMatcher.new(exception, message, &block)
92
end
93
+
94
+ # CRuby < 4.1 has inconsistent coercion errors:
95
+ # https://bugs.ruby-lang.org/issues/21864
96
+ # This matcher ignores the message on CRuby < 4.1
97
+ # and checks the message for all other cases, including other Rubies
98
+ private def raise_consistent_error(exception = Exception, message = nil, &block)
99
+ if RUBY_ENGINE == "ruby" and ruby_version_is ""..."4.1"
100
+ message = nil
101
+ end
102
+ RaiseErrorMatcher.new(exception, message, &block)
103
104
0 commit comments