Fix new rubocop warnings

This commit is contained in:
Tom Hughes 2023-09-26 18:35:05 +01:00
parent a18366903e
commit e8af4b85bf
23 changed files with 57 additions and 60 deletions

View file

@ -80,7 +80,7 @@ class LocaleTest < ActiveSupport::TestCase
end
def test_available
assert Locale.available.count <= I18n.available_locales.count
assert_operator Locale.available.count, :<=, I18n.available_locales.count
end
def test_preferred

View file

@ -61,6 +61,6 @@ class PasswordHashTest < ActiveSupport::TestCase
format = Argon2::HashFormat.new(hash)
assert_equal "argon2id", format.variant
assert format.version <= 19
assert_operator format.version, :<=, 19
end
end

View file

@ -20,7 +20,7 @@ class ShortLinkTest < ActiveSupport::TestCase
# smaller range.
distance = Math.sqrt(((lat - lat2)**2) + ((lon - lon2)**2))
max_distance = 360.0 / (1 << (zoom + 8)) * 0.5 * Math.sqrt(5)
assert max_distance > distance, "Maximum expected error exceeded: #{max_distance} <= #{distance} for (#{lat}, #{lon}, #{zoom})."
assert_operator max_distance, :>, distance, "Maximum expected error exceeded: #{max_distance} <= #{distance} for (#{lat}, #{lon}, #{zoom})."
end
end