Module: Dommy::RSpec::CapyStyleMatchers::Negated Private

Included in:
HaveNoButton, HaveNoField, HaveNoLink, HaveNoSelector
Defined in:
lib/dommy/rspec/capy_style_matchers.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Mixin that flips matches? / does_not_match? for the “no_*” matchers, so each negative matcher reads identically to its positive twin but with inverted assertions.

Instance Method Summary collapse

Instance Method Details

#does_not_match?(scope) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


162
163
164
# File 'lib/dommy/rspec/capy_style_matchers.rb', line 162

def does_not_match?(scope)
  !matches?(scope)
end

#failure_messageObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



166
167
168
# File 'lib/dommy/rspec/capy_style_matchers.rb', line 166

def failure_message
  "expected NOT to find #{describe_target}, found #{@matched.size}"
end

#failure_message_when_negatedObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



170
171
172
# File 'lib/dommy/rspec/capy_style_matchers.rb', line 170

def failure_message_when_negated
  "expected to find #{describe_target}, found #{@matched.size}"
end

#matches?(scope) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


158
159
160
# File 'lib/dommy/rspec/capy_style_matchers.rb', line 158

def matches?(scope)
  !super
end