lib/rubocop/cop/rspec/verified_double_reference.rb in rubocop-rspec-2.23.2 vs lib/rubocop/cop/rspec/verified_double_reference.rb in rubocop-rspec-2.24.0
- old
+ new
@@ -77,12 +77,12 @@
message = format(MSG, style: style)
expression = class_reference.source_range
add_offense(expression, message: message) do |corrector|
- violation = class_reference.source
- corrector.replace(expression, correct_style(violation))
+ offense = class_reference.source
+ corrector.replace(expression, correct_style(offense))
opposite_style_detected
end
end
end
@@ -96,14 +96,14 @@
return false unless class_reference_style
class_reference_style != style
end
- def correct_style(violation)
+ def correct_style(offense)
if style == :string
- "'#{violation}'"
+ "'#{offense}'"
else
- violation.gsub(/^['"]|['"]$/, '')
+ offense.gsub(/^['"]|['"]$/, '')
end
end
end
end
end