Class: RuboCop::Cop::Minitest::RefuteInDelta

Inherits:
Base
  • Object
show all
Extended by:
AutoCorrector
Includes:
InDeltaMixin
Defined in:
lib/rubocop/cop/minitest/refute_in_delta.rb

Overview

Enforces the test to use ‘refute_in_delta` instead of using `refute_equal` to compare floats.

Examples:

# bad
refute_equal(0.2, actual)
refute_equal(0.2, actual, 'message')

# good
refute_in_delta(0.2, actual)
refute_in_delta(0.2, actual, 0.001, 'message')

Constant Summary collapse

RESTRICT_ON_SEND =

rubocop:disable InternalAffairs/UselessRestrictOnSend

i[refute_equal].freeze

Constants included from InDeltaMixin

InDeltaMixin::MSG

Method Summary

Methods included from InDeltaMixin

#on_send