summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
f8f7054)
It has never done anything with the argument and rails 5.0 warns
that rails 5.1 will remove the argument.
def test_good_bbox_boundaries
@good_bbox.each do |bbox_string|
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 }
def test_good_bbox_size
@good_bbox.each do |bbox_string|
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
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
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>"
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
Changeset.from_xml(xml, false)
end
- assert_nothing_raised(OSM::APIBadXMLError) do
+ assert_nothing_raised do
Changeset.from_xml(xml, true)
end
end
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
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
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>"
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
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>"
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
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.")
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.")
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>"
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
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>"
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
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>"
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
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>"
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
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>"
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
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>"
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
Way.from_xml(zero_id, true)
end
message_update = assert_raise(OSM::APIBadUserInput) do