Sha256: d0a58c4fd8ffe0fa5953365f7504a35682ecad50f1845f70ef0f2333b790482f

Contents?: true

Size: 641 Bytes

Versions: 6

Compression:

Stored size: 641 Bytes

Contents

require_relative '../../spec_helper'

module Barometer::Query
  describe Format::Coordinates do
    describe '.geo' do
      specify { expect( Format::Coordinates.geo(nil) ).to be_nil }

      it 'parses out the latitude and longitude' do
        expect( Format::Coordinates.geo('11.22,33.44') ).to eq({latitude: 11.22, longitude: 33.44})
      end
    end

    describe '.is?' do
      it 'returns true when valid' do
        expect( Format::Coordinates.is?('40.756054,-73.986951') ).to be_true
      end

      it 'returns false when not valid' do
        expect( Format::Coordinates.is?('90210') ).to be_false
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
barometer-0.9.7 spec/query/formats/coordinates_spec.rb
barometer-0.9.6 spec/query/formats/coordinates_spec.rb
barometer-0.9.5 spec/query/formats/coordinates_spec.rb
barometer-0.9.4 spec/query/formats/coordinates_spec.rb
barometer-0.9.3 spec/query/formats/coordinates_spec.rb
barometer-0.9.2 spec/query/formats/coordinates_spec.rb