Class: RuboCop::Cop::RSpec::ExpectActual
- Inherits:
-
RuboCop::Cop
- Object
- RuboCop::Cop
- RuboCop::Cop::RSpec::ExpectActual
- Includes:
- RSpec::SpecOnly
- Defined in:
- lib/rubocop/cop/rspec/expect_actual.rb
Overview
Checks for ‘expect(…)` calls containing literal values.
Constant Summary collapse
- MSG =
'Provide the actual you are testing to `expect(...)`'.freeze
- SIMPLE_LITERALS =
%i( true false nil int float str sym complex rational regopt ).freeze
- COMPLEX_LITERALS =
%i( array hash pair irange erange regexp ).freeze
Constants included from RSpec::SpecOnly
RSpec::SpecOnly::DEFAULT_CONFIGURATION
Instance Method Summary collapse
Methods included from RSpec::SpecOnly
Instance Method Details
#on_send(node) ⇒ Object
48 49 50 51 52 |
# File 'lib/rubocop/cop/rspec/expect_actual.rb', line 48 def on_send(node) expect_literal(node) do |argument| add_offense(argument, :expression) end end |