Sha256: 5774c8dc5eb03934006af283550b98ec573051e076799583fcca036fc12600bb

Contents?: true

Size: 1.32 KB

Versions: 16

Compression:

Stored size: 1.32 KB

Contents

require 'spec_helper'

describe( RCAP::CAP_1_1::Point ) do
  describe( 'is not valid if' ) do
    before( :each ) do
      @point = RCAP::CAP_1_1::Point.new( :lattitude => 0, :longitude => 0 )
      @point.should( be_valid )
    end

    it( 'does not have a longitude defined' ) do
      @point.longitude = nil
      @point.should_not( be_valid )
    end

    it( 'does not have a valid longitude' ) do
      @point.longitude = RCAP::CAP_1_1::Point::MAX_LONGITUDE + 1
      @point.should_not( be_valid )
      @point.longitude = RCAP::CAP_1_1::Point::MIN_LONGITUDE - 1
      @point.should_not( be_valid )
    end

    it( 'does not have a lattitude defined' ) do
      @point.lattitude = nil
      @point.should_not( be_valid )
    end

    it( 'does not have a valid lattitude' ) do
      @point.lattitude = RCAP::CAP_1_1::Point::MAX_LATTITUDE + 1
      @point.should_not( be_valid )
      @point.lattitude = RCAP::CAP_1_1::Point::MIN_LATTITUDE - 1
      @point.should_not( be_valid )
    end
  end

  context( 'when exported' ) do
    before( :each ) do
      @point = RCAP::CAP_1_1::Point.new( :lattitude => 1, :longitude => 1 )
    end

    context( 'to hash' ) do
      it( 'should export correctly' ) do
        @point.to_h.should == { RCAP::CAP_1_1::Point::LATTITUDE_KEY => 1, RCAP::CAP_1_1::Point::LONGITUDE_KEY => 1 }
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
rcap-1.3.1 spec/cap_1_1/point_spec.rb
rcap-1.3.0 spec/cap_1_1/point_spec.rb
rcap-1.2.4 spec/cap_1_1/point_spec.rb
rcap-1.2.3 spec/cap_1_1/point_spec.rb
rcap-1.2.2 spec/cap_1_1/point_spec.rb
rcap-1.2.1 spec/cap_1_1/point_spec.rb
rcap-1.2.0 spec/cap_1_1/point_spec.rb
rcap-1.1.1 spec/cap_1_1/point_spec.rb
rcap-1.1.0 spec/cap_1_1/point_spec.rb
rcap-1.0.1 spec/cap_1_1/point_spec.rb
rcap-1.0.0 spec/cap_1_1/point_spec.rb
rcap-1.0.0.rc.5 spec/cap_1_1/point_spec.rb
rcap-1.0.0.rc.4 spec/cap_1_1/point_spec.rb
rcap-1.0.0.rc.3 spec/cap_1_1/point_spec.rb
rcap-1.0.0.rc.2 spec/cap_1_1/point_spec.rb
rcap-1.0.0.rc.1 spec/cap_1_1/point_spec.rb