test/helper.rb in terraformer-0.0.7 vs test/helper.rb in terraformer-0.0.8
- old
+ new
@@ -9,12 +9,15 @@
require 'terraformer'
module MiniTest::Expectations
GEOJSON_VALIDATE_URL = 'http://geojsonlint.com/validate'
+ GEOJSON_VALIDATE_HEADERS = {'Content-Type' => 'application/json'}
+ HC = HTTPClient.new
+
def validate_geojson geojson_h
- r = JSON.parse HTTP['Content-Type' => 'application/json'].post(GEOJSON_VALIDATE_URL, json: geojson_h).body
+ r = JSON.parse HC.post(GEOJSON_VALIDATE_URL, geojson_h.to_json, GEOJSON_VALIDATE_HEADERS).body
r['status'].must_equal 'ok'
end
infect_an_assertion :refute_nil, :dont_be_terrible_ok, :unary
infect_an_assertion :validate_geojson, :must_be_valid_geojson, :unary