Class: RuboCop::Cop::RSpecRails::MinitestAssertions::KindOfAssertion
- Inherits:
-
BasicAssertion
- Object
- BasicAssertion
- RuboCop::Cop::RSpecRails::MinitestAssertions::KindOfAssertion
- Defined in:
- lib/rubocop/cop/rspec_rails/minitest_assertions.rb
Overview
:nodoc:
Constant Summary collapse
- MATCHERS =
%i[ assert_kind_of assert_not_kind_of refute_kind_of ].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(expected, actual, failure_message) ⇒ Object
104 105 106 |
# File 'lib/rubocop/cop/rspec_rails/minitest_assertions.rb', line 104 def self.match(expected, actual, ) new(expected, actual, .first) end |
.minitest_assertion(node) ⇒ Object
100 101 |
# File 'lib/rubocop/cop/rspec_rails/minitest_assertions.rb', line 100
def_node_matcher 'self.minitest_assertion', <<~PATTERN # rubocop:disable InternalAffairs/NodeMatcherDirective
(send nil? {:assert_kind_of :assert_no
|
Instance Method Details
#assertion ⇒ Object
108 109 110 |
# File 'lib/rubocop/cop/rspec_rails/minitest_assertions.rb', line 108 def assertion "be_a_kind_of(#{expected})" end |