def test_good_bbox_boundaries
@good_bbox.each do |bbox_string|
- assert_nothing_raised(OSM::APIBadBoundingBox) { BoundingBox.from_s(bbox_string).check_boundaries }
+ assert_nothing_raised { BoundingBox.from_s(bbox_string).check_boundaries }
end
end
def test_good_bbox_size
@good_bbox.each do |bbox_string|
- assert_nothing_raised(OSM::APIBadBoundingBox) { BoundingBox.from_s(bbox_string).check_size }
+ assert_nothing_raised { BoundingBox.from_s(bbox_string).check_size }
end
end
def test_size_to_big
@bad_big_bbox.each do |bbox_string|
bbox = nil
- assert_nothing_raised(OSM::APIBadBoundingBox) { bbox = BoundingBox.from_bbox_params(:bbox => bbox_string).check_boundaries }
+ assert_nothing_raised { bbox = BoundingBox.from_bbox_params(:bbox => bbox_string).check_boundaries }
exception = assert_raise(OSM::APIBadBoundingBox) { bbox.check_size }
assert_equal(@size_error_message, exception.message)
end
def test_from_xml_valid
# Example taken from the Update section on the API_v0.6 docs on the wiki
xml = "<osm><changeset><tag k=\"comment\" v=\"Just adding some streetnames and a restaurant\"/></changeset></osm>"
- assert_nothing_raised(OSM::APIBadXMLError) do
+ assert_nothing_raised do
Changeset.from_xml(xml, false)
end
- assert_nothing_raised(OSM::APIBadXMLError) do
+ assert_nothing_raised do
Changeset.from_xml(xml, true)
end
end
version = 1
noid = "<osm><node lat='#{lat}' lon='#{lon}' changeset='#{changeset}' version='#{version}' /></osm>"
# First try a create which doesn't need the id
- assert_nothing_raised(OSM::APIBadXMLError) do
+ assert_nothing_raised do
Node.from_xml(noid, true)
end
# Now try an update with no id, and make sure that it gives the appropriate exception
def test_from_xml_no_version
no_version = "<osm><node id='123' lat='23' lon='23' changeset='23' /></osm>"
- assert_nothing_raised(OSM::APIBadXMLError) do
+ assert_nothing_raised do
Node.from_xml(no_version, true)
end
message_update = assert_raise(OSM::APIBadXMLError) do
id_list = ["", "0", "00", "0.0", "a"]
id_list.each do |id|
zero_id = "<osm><node id='#{id}' lat='12.3' lon='12.3' changeset='33' version='23' /></osm>"
- assert_nothing_raised(OSM::APIBadUserInput) do
+ assert_nothing_raised do
Node.from_xml(zero_id, true)
end
message_update = assert_raise(OSM::APIBadUserInput) do
r = create(:redaction)
assert_equal(false, node_v1.redacted?, "Expected node to not be redacted already.")
- assert_nothing_raised(OSM::APICannotRedactError) do
+ assert_nothing_raised do
node_v1.redact!(r)
end
assert_equal(true, node_v1.redacted?, "Expected node version 1 to be redacted after redact! call.")
class RelationTest < ActiveSupport::TestCase
def test_from_xml_no_id
noid = "<osm><relation version='12' changeset='23' /></osm>"
- assert_nothing_raised(OSM::APIBadXMLError) do
+ assert_nothing_raised do
Relation.from_xml(noid, true)
end
message = assert_raise(OSM::APIBadXMLError) do
def test_from_xml_no_version
no_version = "<osm><relation id='123' changeset='23' /></osm>"
- assert_nothing_raised(OSM::APIBadXMLError) do
+ assert_nothing_raised do
Relation.from_xml(no_version, true)
end
message_update = assert_raise(OSM::APIBadXMLError) do
id_list = ["", "0", "00", "0.0", "a"]
id_list.each do |id|
zero_id = "<osm><relation id='#{id}' changeset='332' version='23' /></osm>"
- assert_nothing_raised(OSM::APIBadUserInput) do
+ assert_nothing_raised do
Relation.from_xml(zero_id, true)
end
message_update = assert_raise(OSM::APIBadUserInput) do
def test_from_xml_no_id
noid = "<osm><way version='12' changeset='23' /></osm>"
- assert_nothing_raised(OSM::APIBadXMLError) do
+ assert_nothing_raised do
Way.from_xml(noid, true)
end
message = assert_raise(OSM::APIBadXMLError) do
def test_from_xml_no_version
no_version = "<osm><way id='123' changeset='23' /></osm>"
- assert_nothing_raised(OSM::APIBadXMLError) do
+ assert_nothing_raised do
Way.from_xml(no_version, true)
end
message_update = assert_raise(OSM::APIBadXMLError) do
id_list = ["", "0", "00", "0.0", "a"]
id_list.each do |id|
zero_id = "<osm><way id='#{id}' changeset='33' version='23' /></osm>"
- assert_nothing_raised(OSM::APIBadUserInput) do
+ assert_nothing_raised do
Way.from_xml(zero_id, true)
end
message_update = assert_raise(OSM::APIBadUserInput) do