Sha256: efd45e07bb3438286d6200d63763025632828d4db60c0b15b0fe45d03b018da3

Contents?: true

Size: 757 Bytes

Versions: 2

Compression:

Stored size: 757 Bytes

Contents

require 'spec_helper'

describe 'Endpoints Orion server' do

  before(:each) do
    @sut = Orion::Geo.new
  end

  describe 'Store geolocalisation data for object' do

    context 'build a area' do
      it 'should return circle' do
        actual = @sut.instance_eval{get_area('circle', [2,3,2])}
        expected = {circle: {centerLatitude: 2, centerLongitude: 3, radius: 2}}
        expect(actual).to eq(expected)
      end

      it 'should return a polygon' do
        actual = @sut.instance_eval{get_area('polygon', ['1,2','4,5','3,2'])}
        expected = {polygon: {vertices: [{ latitude: '1', longitude: '2' }, { latitude: '4', longitude: '5' },{ latitude: '3', longitude: '2'}]}}
        expect(actual).to eq(expected)
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fiware-orion-geo-0.0.3 spec/fiware_orion_geo_spec.rb
fiware-orion-geo-0.0.2 spec/fiware_orion_geo_spec.rb