Class: RuboCop::Cop::RSpecRails::MinitestAssertions::MatchAssertion
- Inherits:
-
BasicAssertion
- Object
- BasicAssertion
- RuboCop::Cop::RSpecRails::MinitestAssertions::MatchAssertion
- Defined in:
- lib/rubocop/cop/rspec_rails/minitest_assertions.rb
Overview
:nodoc:
Constant Summary collapse
- MATCHERS =
%i[ assert_match refute_match ].freeze
Instance Attribute Summary
Attributes inherited from BasicAssertion
#actual, #expected, #failure_message
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from BasicAssertion
#initialize, #negated?, #replaced
Constructor Details
This class inherits a constructor from RuboCop::Cop::RSpecRails::MinitestAssertions::BasicAssertion
Class Method Details
.match(matcher, actual, failure_message) ⇒ Object
221 222 223 |
# File 'lib/rubocop/cop/rspec_rails/minitest_assertions.rb', line 221 def self.match(matcher, actual, ) new(matcher, actual, .first) end |
.minitest_assertion(node) ⇒ Object
217 218 |
# File 'lib/rubocop/cop/rspec_rails/minitest_assertions.rb', line 217
def_node_matcher 'self.minitest_assertion', <<~PATTERN # rubocop:disable InternalAffairs/NodeMatcherDirective
(send nil? {:a
|
Instance Method Details
#assertion ⇒ Object
225 226 227 |
# File 'lib/rubocop/cop/rspec_rails/minitest_assertions.rb', line 225 def assertion "match(#{expected})" end |