lib/rubocop/cop/rspec/expect_actual.rb in rubocop-rspec-2.0.0 vs lib/rubocop/cop/rspec/expect_actual.rb in rubocop-rspec-2.0.1
- old
+ new
@@ -58,9 +58,10 @@
def on_send(node)
expect_literal(node) do |actual, matcher, expected|
add_offense(actual.source_range) do |corrector|
next unless SUPPORTED_MATCHERS.include?(matcher)
+ next if literal?(expected)
swap(corrector, actual, expected)
end
end
end