Sha256: a7bfa6e3d6b56db7c1a1ecfc11910d4a8077931f4a1e768e587fe92b4c7d486b

Contents?: true

Size: 949 Bytes

Versions: 5

Compression:

Stored size: 949 Bytes

Contents

require 'bundler'
Bundler.require :default, :test

require 'minitest/autorun'
require 'minitest/pride'

lib = File.expand_path '../../lib', __FILE__
$:.unshift lib unless $:.include? lib
require 'terraformer'

module MiniTest::Expectations

  GEOJSON_VALIDATE_URL = 'http://geojsonlint.com/validate'

  def validate_geojson geojson_h
    r = JSON.parse HTTP['Content-Type' => 'application/json'].post(GEOJSON_VALIDATE_URL, json: geojson_h).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
end

examples = File.expand_path '../examples', __FILE__
EXAMPLES = Dir[examples + '/*.geojson'].reduce({}) do |h, gj|
  h[gj.sub(examples+'/','').sub(/\.geojson$/,'').to_sym] =
    File.read(gj).gsub(/\r*\n*/,'').gsub('  ',' ')
  h
end

PARSED_EXAMPLES = EXAMPLES.keys.reduce({}){|h,k| h[k] = Terraformer.parse EXAMPLES[k]; h}

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
terraformer-0.0.7 test/helper.rb
terraformer-0.0.6 test/helper.rb
terraformer-0.0.4 test/helper.rb
terraformer-0.0.3 test/helper.rb
terraformer-0.0.2 test/helper.rb