Skip to content
This repository has been archived by the owner on Nov 30, 2024. It is now read-only.

Commit

Permalink
Handle Regexp like String when apportioning args
Browse files Browse the repository at this point in the history
If the first argument is a Regexp, it's a message _matcher_, rather than
a message.. but certainly it's not an exception! I'm actually a bit
surprised this doesn't cause any other problems, but it doesn't seem to.
  • Loading branch information
nevinera committed May 8, 2024
1 parent 9c9593d commit 157aa2c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rspec/matchers/built_in/raise_error.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def initialize(expected_error_or_message, expected_message, &block)
when nil, UndefinedValue
@expected_error = Exception
@expected_message = expected_message
when String
when String, Regexp
@expected_error = Exception
@expected_message = expected_error_or_message
else
Expand Down

0 comments on commit 157aa2c

Please sign in to comment.