@@ -42,8 +42,9 @@ def test_decode
4242 end
4343
4444 def test_encode
45- # Allow a 5% error rate encoding from degree coordinates (because of floating point precision).
46- allowedErrorRate = 0.05
45+ # Allow a 5% error rate encoding from degree coordinates (because of
46+ # floating point precision).
47+ allowed_error_rate = 0.05
4748 errors = 0
4849 tests = 0
4950 read_csv_lines ( 'encoding.csv' ) . each do |line |
@@ -62,7 +63,7 @@ def test_encode
6263 puts "ENCODING DIFFERENCE: want #{ want } , got #{ code } "
6364 end
6465 end
65- assert_compare ( errors . to_f / tests . to_f , "<=" , allowedErrorRate )
66+ assert_compare ( errors . to_f / tests , '<=' , allowed_error_rate )
6667 end
6768
6869 def test_location_to_integers
@@ -76,7 +77,8 @@ def test_location_to_integers
7677 lng_integer = cols [ 3 ] . to_i
7778
7879 got_lat , got_lng = @olc . location_to_integers ( lat_degrees , lng_degrees )
79- # Due to floating point precision limitations, we may get values 1 less than expected.
80+ # Due to floating point precision limitations, we may get values 1 less
81+ # than expected.
8082 assert_include ( [ lat_integer - 1 , lat_integer ] , got_lat )
8183 assert_include ( [ lng_integer - 1 , lng_integer ] , got_lng )
8284 end
0 commit comments