Module: RuboCop::Cop::InDeltaMixin Private
- Included in:
- Minitest::AssertInDelta, Minitest::RefuteInDelta
- Defined in:
- lib/rubocop/cop/mixin/in_delta_mixin.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Common functionality for ‘AssertInDelta` and `RefuteInDelta` cops.
Constant Summary collapse
- MSG =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
'Prefer using `%<good_method>s`.'
Instance Method Summary collapse
- #on_send(node) ⇒ Object private
Instance Method Details
#on_send(node) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/rubocop/cop/mixin/in_delta_mixin.rb', line 10 def on_send(node) equal_floats_call(node) do |expected, actual, | = .first good_method = build_good_method(expected, actual, ) if expected.float_type? || actual.float_type? = format(MSG, good_method: good_method) add_offense(node, message: ) do |corrector| corrector.replace(node, good_method) end end end end |