assert_similar arg1 (anything), arg2 (anything)
Raises an exception if both arguments aren’t similar.
Currently similarity is only defined for numbers - all other types are compared for equality with assert_equal.
Useful for testing in cases where floating point imprecision stops you from being able to use assert_equal
.
Introduced in v3.0
# Example 1 | |
|
|
# Example 2 | |
|
|