Class: RuboCop::Cop::RSpec::ExpectActual
- 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(...)`.'
- 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 inherited from Cop
Cop::DEFAULT_CONFIGURATION, Cop::DEFAULT_PATTERN_RE
Constants included from RSpec::Language
RSpec::Language::ALL, RSpec::Language::RSPEC
Instance Method Summary collapse
Methods inherited from Cop
Instance Method Details
#on_send(node) ⇒ Object
46 47 48 49 50 |
# File 'lib/rubocop/cop/rspec/expect_actual.rb', line 46 def on_send(node) expect_literal(node) do |argument| add_offense(argument, location: :expression) end end |