Class: RuboCop::Cop::Minitest::AssertInDelta

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

Overview

Enforces the test to use ‘assert_in_delta` instead of using `assert_equal` to compare floats.

Examples:

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

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

Constant Summary collapse

RESTRICT_ON_SEND =

rubocop:disable InternalAffairs/UselessRestrictOnSend

i[assert_equal].freeze

Constants included from InDeltaMixin

InDeltaMixin::MSG

Method Summary

Methods included from InDeltaMixin

#on_send