Skip to content

Commit

Permalink
Add a comment about where UndefinedValue is used
Browse files Browse the repository at this point in the history
this confused us at a glance, and it probably will again later
  • Loading branch information
nevinera committed May 9, 2024
1 parent 8a05ba4 commit f85ca83
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/rspec/matchers/built_in/raise_error.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ class RaiseError
# argument. We can't use `nil` for that because we need to warn when `nil` is
# passed in a different way. It's an Object, not a Module, since Module's `===`
# does not evaluate to true when compared to itself.
#
# Note; this _is_ the default value supplied for expected_error_or_message, but
# because there are two method-calls involved, that default is actually supplied
# in the definition of the _matcher_ method, `RSpec::Matchers#raise_error`
UndefinedValue = Object.new.freeze

def initialize(expected_error_or_message, expected_message, &block)
Expand Down

0 comments on commit f85ca83

Please sign in to comment.