1 # frozen_string_literal: true
5 class OsmTest < ActiveSupport::TestCase
7 proj = OSM::Mercator.new(0, 0, 1, 1, 100, 200)
8 assert_in_delta(50, proj.x(0.5), 0.01)
9 assert_in_delta(100, proj.y(0.5), 0.01)
12 def test_mercator_collapsed_bbox
13 proj = OSM::Mercator.new(0, 0, 0, 0, 100, 200)
14 assert_in_delta(50, proj.x(0), 0.01)
15 assert_in_delta(100, proj.y(0), 0.01)
18 def test_legal_text_for_country
19 OSM::LEGALES.each do |legale|
20 text = OSM.legal_text_for_country(legale)
22 assert_predicate text["intro"], :html_safe?
26 def test_legal_text_for_unknown_country
27 default_text = OSM.legal_text_for_country(Settings.default_legale)
29 ["ZZ", "..", "../../config/settings", "/etc/passwd", "GB\n../../config/settings", nil]
31 assert_equal default_text, OSM.legal_text_for_country(legale)