Module: Dommy::RSpec::CapyStyleMatchers::FailureContext
- Defined in:
- lib/dommy/rspec/capy_style_matchers.rb
Overview
Prepended to every concrete matcher so it sits first in the method
resolution order: it remembers the matched subject and wraps the
matcher's own failure_message (via super) with any extra context a
host registered through Dommy::RSpec.failure_context (e.g. dommy-rails
appends a recent trace for a trace-enabled session). With no context
registered the message is returned unchanged, so existing behavior — and
existing message assertions — are preserved.
Instance Method Summary collapse
- #does_not_match?(scope) ⇒ Boolean
- #failure_message ⇒ Object
- #failure_message_when_negated ⇒ Object
- #matches?(scope) ⇒ Boolean
Instance Method Details
#does_not_match?(scope) ⇒ Boolean
443 444 445 446 |
# File 'lib/dommy/rspec/capy_style_matchers.rb', line 443 def does_not_match?(scope) @__dommy_subject = scope super end |
#failure_message ⇒ Object
448 449 450 |
# File 'lib/dommy/rspec/capy_style_matchers.rb', line 448 def Dommy::RSpec.__decorate_failure(super, @__dommy_subject) end |
#failure_message_when_negated ⇒ Object
452 453 454 |
# File 'lib/dommy/rspec/capy_style_matchers.rb', line 452 def Dommy::RSpec.__decorate_failure(super, @__dommy_subject) end |
#matches?(scope) ⇒ Boolean
438 439 440 441 |
# File 'lib/dommy/rspec/capy_style_matchers.rb', line 438 def matches?(scope) @__dommy_subject = scope super end |