Skip to content

Commit

Permalink
test: use assert_in_delta for comparing floats
Browse files Browse the repository at this point in the history
  • Loading branch information
tonytonyjan committed Sep 28, 2017
1 parent 104c1af commit feca1a5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/test_jaro_winkler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,11 @@ def test_long_string
private

def assert_distance score, str1, str2, options={}
assert_equal score, JaroWinkler.distance(str1, str2, options).round(4)
assert_in_delta score, JaroWinkler.distance(str1, str2, options)
end

def assert_jaro_distance score, str1, str2, options={}
assert_equal score, JaroWinkler.jaro_distance(str1, str2, options).round(4)
assert_in_delta score, JaroWinkler.jaro_distance(str1, str2, options)
end

end
end

0 comments on commit feca1a5

Please sign in to comment.