aixm 0.3.7 → 0.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/.github/workflows/test.yml +26 -0
 - data/.ruby-version +1 -1
 - data/CHANGELOG.md +17 -4
 - data/README.md +23 -5
 - data/lib/aixm/component/fato.rb +3 -3
 - data/lib/aixm/component/frequency.rb +1 -1
 - data/lib/aixm/component/geometry/border.rb +9 -3
 - data/lib/aixm/component/helipad.rb +1 -1
 - data/lib/aixm/component/lighting.rb +1 -1
 - data/lib/aixm/component/runway.rb +4 -7
 - data/lib/aixm/config.rb +2 -1
 - data/lib/aixm/document.rb +1 -0
 - data/lib/aixm/feature/address.rb +1 -1
 - data/lib/aixm/feature/airport.rb +13 -4
 - data/lib/aixm/feature/airspace.rb +11 -8
 - data/lib/aixm/feature/navigational_aid/designated_point.rb +1 -1
 - data/lib/aixm/feature/navigational_aid/dme.rb +1 -1
 - data/lib/aixm/feature/navigational_aid/marker.rb +1 -1
 - data/lib/aixm/feature/navigational_aid/ndb.rb +1 -1
 - data/lib/aixm/feature/navigational_aid/tacan.rb +1 -1
 - data/lib/aixm/feature/navigational_aid/vor.rb +1 -1
 - data/lib/aixm/feature/obstacle.rb +1 -1
 - data/lib/aixm/feature/obstacle_group.rb +1 -1
 - data/lib/aixm/feature/organisation.rb +1 -1
 - data/lib/aixm/feature/service.rb +1 -1
 - data/lib/aixm/feature/unit.rb +1 -1
 - data/lib/aixm/refinements.rb +39 -8
 - data/lib/aixm/version.rb +1 -1
 - data/rakefile.rb +22 -8
 - data/spec/lib/aixm/a_spec.rb +55 -55
 - data/spec/lib/aixm/component/fato_spec.rb +30 -23
 - data/spec/lib/aixm/component/frequency_spec.rb +12 -13
 - data/spec/lib/aixm/component/geometry/arc_spec.rb +7 -9
 - data/spec/lib/aixm/component/geometry/border_spec.rb +8 -3
 - data/spec/lib/aixm/component/geometry/circle_spec.rb +6 -8
 - data/spec/lib/aixm/component/geometry/point_spec.rb +2 -4
 - data/spec/lib/aixm/component/geometry_spec.rb +57 -62
 - data/spec/lib/aixm/component/helipad_spec.rb +25 -19
 - data/spec/lib/aixm/component/layer_spec.rb +17 -19
 - data/spec/lib/aixm/component/lighting_spec.rb +21 -15
 - data/spec/lib/aixm/component/runway_spec.rb +44 -37
 - data/spec/lib/aixm/component/surface_spec.rb +24 -24
 - data/spec/lib/aixm/component/timetable_spec.rb +7 -9
 - data/spec/lib/aixm/component/vertical_limits_spec.rb +9 -12
 - data/spec/lib/aixm/config_spec.rb +8 -8
 - data/spec/lib/aixm/d_spec.rb +28 -28
 - data/spec/lib/aixm/document_spec.rb +46 -37
 - data/spec/lib/aixm/errors_spec.rb +2 -2
 - data/spec/lib/aixm/f_spec.rb +16 -16
 - data/spec/lib/aixm/feature/address_spec.rb +12 -7
 - data/spec/lib/aixm/feature/airport_spec.rb +80 -74
 - data/spec/lib/aixm/feature/airspace_spec.rb +32 -28
 - data/spec/lib/aixm/feature/navigational_aid/designated_point_spec.rb +16 -11
 - data/spec/lib/aixm/feature/navigational_aid/dme_spec.rb +22 -16
 - data/spec/lib/aixm/feature/navigational_aid/marker_spec.rb +13 -7
 - data/spec/lib/aixm/feature/navigational_aid/ndb_spec.rb +15 -9
 - data/spec/lib/aixm/feature/navigational_aid/tacan_spec.rb +22 -16
 - data/spec/lib/aixm/feature/navigational_aid/vor_spec.rb +21 -15
 - data/spec/lib/aixm/feature/navigational_aid_spec.rb +6 -6
 - data/spec/lib/aixm/feature/obstacle_group_spec.rb +25 -21
 - data/spec/lib/aixm/feature/obstacle_spec.rb +47 -42
 - data/spec/lib/aixm/feature/organisation_spec.rb +16 -10
 - data/spec/lib/aixm/feature/service_spec.rb +9 -9
 - data/spec/lib/aixm/feature/unit_spec.rb +21 -13
 - data/spec/lib/aixm/feature_spec.rb +5 -5
 - data/spec/lib/aixm/p_spec.rb +37 -37
 - data/spec/lib/aixm/refinements_spec.rb +164 -115
 - data/spec/lib/aixm/version_spec.rb +1 -1
 - data/spec/lib/aixm/w_spec.rb +28 -28
 - data/spec/lib/aixm/xy_spec.rb +34 -34
 - data/spec/lib/aixm/z_spec.rb +19 -19
 - data/spec/macros/marking.rb +3 -3
 - data/spec/macros/organisation.rb +2 -2
 - data/spec/macros/remarks.rb +3 -3
 - data/spec/macros/timetable.rb +2 -2
 - data/spec/macros/xy.rb +2 -2
 - data/spec/macros/z_qnh.rb +2 -2
 - data/spec/spec_helper.rb +7 -0
 - metadata +3 -3
 - data/.travis.yml +0 -8
 
| 
         @@ -11,56 +11,56 @@ describe AIXM::Component::Frequency do 
     | 
|
| 
       11 
11 
     | 
    
         
             
                    transmission_f: AIXM.f(123.35, :mhz),
         
     | 
| 
       12 
12 
     | 
    
         
             
                    callsigns: { en: "PUJAUT CONTROL", fr: "PUJAUT CONTROLE" }
         
     | 
| 
       13 
13 
     | 
    
         
             
                  )
         
     | 
| 
       14 
     | 
    
         
            -
                  subject.reception_f.must_equal subject.transmission_f
         
     | 
| 
      
 14 
     | 
    
         
            +
                  _(subject.reception_f).must_equal subject.transmission_f
         
     | 
| 
       15 
15 
     | 
    
         
             
                end
         
     | 
| 
       16 
16 
     | 
    
         
             
              end
         
     | 
| 
       17 
17 
     | 
    
         | 
| 
       18 
18 
     | 
    
         
             
              describe :transmission_f= do
         
     | 
| 
       19 
19 
     | 
    
         
             
                it "fails on invalid values" do
         
     | 
| 
       20 
     | 
    
         
            -
                  [nil, :foobar, 123].wont_be_written_to subject, :transmission_f
         
     | 
| 
      
 20 
     | 
    
         
            +
                  _([nil, :foobar, 123]).wont_be_written_to subject, :transmission_f
         
     | 
| 
       21 
21 
     | 
    
         
             
                end
         
     | 
| 
       22 
22 
     | 
    
         | 
| 
       23 
23 
     | 
    
         
             
                it "accepts valid values" do
         
     | 
| 
       24 
     | 
    
         
            -
                  [AIXM::Factory.f].must_be_written_to subject, :transmission_f
         
     | 
| 
      
 24 
     | 
    
         
            +
                  _([AIXM::Factory.f]).must_be_written_to subject, :transmission_f
         
     | 
| 
       25 
25 
     | 
    
         
             
                end
         
     | 
| 
       26 
26 
     | 
    
         
             
              end
         
     | 
| 
       27 
27 
     | 
    
         | 
| 
       28 
28 
     | 
    
         
             
              describe :callsigns= do
         
     | 
| 
       29 
29 
     | 
    
         
             
                it "fails on invalid values" do
         
     | 
| 
       30 
     | 
    
         
            -
                  [nil, :foobar, 123].wont_be_written_to subject, :callsigns
         
     | 
| 
      
 30 
     | 
    
         
            +
                  _([nil, :foobar, 123]).wont_be_written_to subject, :callsigns
         
     | 
| 
       31 
31 
     | 
    
         
             
                end
         
     | 
| 
       32 
32 
     | 
    
         | 
| 
       33 
33 
     | 
    
         
             
                it "downcases language codes" do
         
     | 
| 
       34 
     | 
    
         
            -
                  subject.tap { |s| s.callsigns = { EN: "FOOBAR" } }.callsigns.must_equal(en: "FOOBAR")
         
     | 
| 
      
 34 
     | 
    
         
            +
                  _(subject.tap { |s| s.callsigns = { EN: "FOOBAR" } }.callsigns).must_equal(en: "FOOBAR")
         
     | 
| 
       35 
35 
     | 
    
         
             
                end
         
     | 
| 
       36 
36 
     | 
    
         | 
| 
       37 
37 
     | 
    
         
             
                it "upcases and transcodes callsigns" do
         
     | 
| 
       38 
     | 
    
         
            -
                  subject.tap { |s| s.callsigns = { fr: "Nîmes-Alès" } }.callsigns.must_equal(fr: "NIMES-ALES")
         
     | 
| 
      
 38 
     | 
    
         
            +
                  _(subject.tap { |s| s.callsigns = { fr: "Nîmes-Alès" } }.callsigns).must_equal(fr: "NIMES-ALES")
         
     | 
| 
       39 
39 
     | 
    
         
             
                end
         
     | 
| 
       40 
40 
     | 
    
         
             
              end
         
     | 
| 
       41 
41 
     | 
    
         | 
| 
       42 
42 
     | 
    
         
             
              describe :reception_f= do
         
     | 
| 
       43 
43 
     | 
    
         
             
                it "fails on invalid values" do
         
     | 
| 
       44 
     | 
    
         
            -
                  [:foobar, 123].wont_be_written_to subject, :reception_f
         
     | 
| 
      
 44 
     | 
    
         
            +
                  _([:foobar, 123]).wont_be_written_to subject, :reception_f
         
     | 
| 
       45 
45 
     | 
    
         
             
                end
         
     | 
| 
       46 
46 
     | 
    
         | 
| 
       47 
47 
     | 
    
         
             
                it "accepts valid values" do
         
     | 
| 
       48 
     | 
    
         
            -
                  [nil, AIXM::Factory.f].must_be_written_to subject, :reception_f
         
     | 
| 
      
 48 
     | 
    
         
            +
                  _([nil, AIXM::Factory.f]).must_be_written_to subject, :reception_f
         
     | 
| 
       49 
49 
     | 
    
         
             
                end
         
     | 
| 
       50 
50 
     | 
    
         
             
              end
         
     | 
| 
       51 
51 
     | 
    
         | 
| 
       52 
52 
     | 
    
         
             
              describe :type= do
         
     | 
| 
       53 
53 
     | 
    
         
             
                it "fails on invalid values" do
         
     | 
| 
       54 
     | 
    
         
            -
                   
     | 
| 
      
 54 
     | 
    
         
            +
                  _{ subject.type = :foobar }.must_raise ArgumentError
         
     | 
| 
       55 
55 
     | 
    
         
             
                end
         
     | 
| 
       56 
56 
     | 
    
         | 
| 
       57 
57 
     | 
    
         
             
                it "accepts nil value" do
         
     | 
| 
       58 
     | 
    
         
            -
                  [nil].must_be_written_to subject, :type
         
     | 
| 
      
 58 
     | 
    
         
            +
                  _([nil]).must_be_written_to subject, :type
         
     | 
| 
       59 
59 
     | 
    
         
             
                end
         
     | 
| 
       60 
60 
     | 
    
         | 
| 
       61 
61 
     | 
    
         
             
                it "looks up valid values" do
         
     | 
| 
       62 
     | 
    
         
            -
                  subject.tap { |s| s.type = :standard }.type.must_equal :standard
         
     | 
| 
       63 
     | 
    
         
            -
                  subject.tap { |s| s.type = :ALT }.type.must_equal :alternative
         
     | 
| 
      
 62 
     | 
    
         
            +
                  _(subject.tap { |s| s.type = :standard }.type).must_equal :standard
         
     | 
| 
      
 63 
     | 
    
         
            +
                  _(subject.tap { |s| s.type = :ALT }.type).must_equal :alternative
         
     | 
| 
       64 
64 
     | 
    
         
             
                end
         
     | 
| 
       65 
65 
     | 
    
         
             
              end
         
     | 
| 
       66 
66 
     | 
    
         | 
| 
         @@ -71,5 +71,4 @@ describe AIXM::Component::Frequency do 
     | 
|
| 
       71 
71 
     | 
    
         
             
              describe :remarks= do
         
     | 
| 
       72 
72 
     | 
    
         
             
                macro :remarks
         
     | 
| 
       73 
73 
     | 
    
         
             
              end
         
     | 
| 
       74 
     | 
    
         
            -
             
     | 
| 
       75 
74 
     | 
    
         
             
            end
         
     | 
| 
         @@ -11,25 +11,25 @@ describe AIXM::Component::Geometry::Arc do 
     | 
|
| 
       11 
11 
     | 
    
         | 
| 
       12 
12 
     | 
    
         
             
              describe :center_xy= do
         
     | 
| 
       13 
13 
     | 
    
         
             
                it "fails on invalid values" do
         
     | 
| 
       14 
     | 
    
         
            -
                  [nil, 123].wont_be_written_to subject, :xy
         
     | 
| 
      
 14 
     | 
    
         
            +
                  _([nil, 123]).wont_be_written_to subject, :xy
         
     | 
| 
       15 
15 
     | 
    
         
             
                end
         
     | 
| 
       16 
16 
     | 
    
         | 
| 
       17 
17 
     | 
    
         
             
                it "accepts valid values" do
         
     | 
| 
       18 
     | 
    
         
            -
                  [AIXM::Factory.xy].must_be_written_to subject, :xy
         
     | 
| 
      
 18 
     | 
    
         
            +
                  _([AIXM::Factory.xy]).must_be_written_to subject, :xy
         
     | 
| 
       19 
19 
     | 
    
         
             
                end
         
     | 
| 
       20 
20 
     | 
    
         
             
              end
         
     | 
| 
       21 
21 
     | 
    
         | 
| 
       22 
22 
     | 
    
         
             
              describe :clockwise= do
         
     | 
| 
       23 
23 
     | 
    
         
             
                it "fails on invalid values" do
         
     | 
| 
       24 
     | 
    
         
            -
                  [nil, 0].wont_be_written_to subject, :clockwise
         
     | 
| 
      
 24 
     | 
    
         
            +
                  _([nil, 0]).wont_be_written_to subject, :clockwise
         
     | 
| 
       25 
25 
     | 
    
         
             
                end
         
     | 
| 
       26 
26 
     | 
    
         
             
              end
         
     | 
| 
       27 
27 
     | 
    
         | 
| 
       28 
28 
     | 
    
         
             
              describe :clockwise? do
         
     | 
| 
       29 
29 
     | 
    
         
             
                it "must return true or false" do
         
     | 
| 
       30 
30 
     | 
    
         
             
                  xy = AIXM.xy(lat: 11.1, long: 22.2)
         
     | 
| 
       31 
     | 
    
         
            -
                  AIXM.arc(xy: xy, center_xy: xy, clockwise: true).must_be :clockwise?
         
     | 
| 
       32 
     | 
    
         
            -
                  AIXM.arc(xy: xy, center_xy: xy, clockwise: false).wont_be :clockwise?
         
     | 
| 
      
 31 
     | 
    
         
            +
                  _(AIXM.arc(xy: xy, center_xy: xy, clockwise: true)).must_be :clockwise?
         
     | 
| 
      
 32 
     | 
    
         
            +
                  _(AIXM.arc(xy: xy, center_xy: xy, clockwise: false)).wont_be :clockwise?
         
     | 
| 
       33 
33 
     | 
    
         
             
                end
         
     | 
| 
       34 
34 
     | 
    
         
             
              end
         
     | 
| 
       35 
35 
     | 
    
         | 
| 
         @@ -40,8 +40,7 @@ describe AIXM::Component::Geometry::Arc do 
     | 
|
| 
       40 
40 
     | 
    
         
             
                    center_xy: AIXM.xy(lat: 22.2, long: 33.3),
         
     | 
| 
       41 
41 
     | 
    
         
             
                    clockwise: true
         
     | 
| 
       42 
42 
     | 
    
         
             
                  )
         
     | 
| 
       43 
     | 
    
         
            -
                   
     | 
| 
       44 
     | 
    
         
            -
                  subject.to_xml.must_equal <<~END
         
     | 
| 
      
 43 
     | 
    
         
            +
                  _(subject.to_xml).must_equal <<~END
         
     | 
| 
       45 
44 
     | 
    
         
             
                    <Avx>
         
     | 
| 
       46 
45 
     | 
    
         
             
                      <codeType>CWA</codeType>
         
     | 
| 
       47 
46 
     | 
    
         
             
                      <geoLat>110600.00N</geoLat>
         
     | 
| 
         @@ -59,8 +58,7 @@ describe AIXM::Component::Geometry::Arc do 
     | 
|
| 
       59 
58 
     | 
    
         
             
                    center_xy: AIXM.xy(lat: 22.2, long: 33.3),
         
     | 
| 
       60 
59 
     | 
    
         
             
                    clockwise: false
         
     | 
| 
       61 
60 
     | 
    
         
             
                  )
         
     | 
| 
       62 
     | 
    
         
            -
                   
     | 
| 
       63 
     | 
    
         
            -
                  subject.to_xml.must_equal <<~END
         
     | 
| 
      
 61 
     | 
    
         
            +
                  _(subject.to_xml).must_equal <<~END
         
     | 
| 
       64 
62 
     | 
    
         
             
                    <Avx>
         
     | 
| 
       65 
63 
     | 
    
         
             
                      <codeType>CCA</codeType>
         
     | 
| 
       66 
64 
     | 
    
         
             
                      <geoLat>110600.00N</geoLat>
         
     | 
| 
         @@ -10,14 +10,13 @@ describe AIXM::Component::Geometry::Border do 
     | 
|
| 
       10 
10 
     | 
    
         | 
| 
       11 
11 
     | 
    
         
             
              describe :name= do
         
     | 
| 
       12 
12 
     | 
    
         
             
                it "fails on invalid values" do
         
     | 
| 
       13 
     | 
    
         
            -
                  [nil, :foobar, 123].wont_be_written_to subject, :name
         
     | 
| 
      
 13 
     | 
    
         
            +
                  _([nil, :foobar, 123]).wont_be_written_to subject, :name
         
     | 
| 
       14 
14 
     | 
    
         
             
                end
         
     | 
| 
       15 
15 
     | 
    
         
             
              end
         
     | 
| 
       16 
16 
     | 
    
         | 
| 
       17 
17 
     | 
    
         
             
              describe :to_xml do
         
     | 
| 
       18 
18 
     | 
    
         
             
                it "builds correct AIXM" do
         
     | 
| 
       19 
     | 
    
         
            -
                   
     | 
| 
       20 
     | 
    
         
            -
                  subject.to_xml.must_equal <<~END
         
     | 
| 
      
 19 
     | 
    
         
            +
                  _(subject.to_xml).must_equal <<~END
         
     | 
| 
       21 
20 
     | 
    
         
             
                    <Avx>
         
     | 
| 
       22 
21 
     | 
    
         
             
                      <GbrUid>
         
     | 
| 
       23 
22 
     | 
    
         
             
                        <txtName>FRANCE-SWITZERLAND</txtName>
         
     | 
| 
         @@ -30,4 +29,10 @@ describe AIXM::Component::Geometry::Border do 
     | 
|
| 
       30 
29 
     | 
    
         
             
                  END
         
     | 
| 
       31 
30 
     | 
    
         
             
                end
         
     | 
| 
       32 
31 
     | 
    
         
             
              end
         
     | 
| 
      
 32 
     | 
    
         
            +
             
     | 
| 
      
 33 
     | 
    
         
            +
              it "builds OFMX with mid" do
         
     | 
| 
      
 34 
     | 
    
         
            +
                AIXM.ofmx!
         
     | 
| 
      
 35 
     | 
    
         
            +
                AIXM.config.mid_region = 'LF'
         
     | 
| 
      
 36 
     | 
    
         
            +
                _(subject.to_xml).must_match /<GbrUid mid="6be76b9b-567e-50f1-5c98-80a76163eebe">/
         
     | 
| 
      
 37 
     | 
    
         
            +
              end
         
     | 
| 
       33 
38 
     | 
    
         
             
            end
         
     | 
| 
         @@ -10,23 +10,23 @@ describe AIXM::Component::Geometry::Circle do 
     | 
|
| 
       10 
10 
     | 
    
         | 
| 
       11 
11 
     | 
    
         
             
              describe :center_xy= do
         
     | 
| 
       12 
12 
     | 
    
         
             
                it "fails on invalid values" do
         
     | 
| 
       13 
     | 
    
         
            -
                  [nil, 123].wont_be_written_to subject, :center_xy
         
     | 
| 
      
 13 
     | 
    
         
            +
                  _([nil, 123]).wont_be_written_to subject, :center_xy
         
     | 
| 
       14 
14 
     | 
    
         
             
                end
         
     | 
| 
       15 
15 
     | 
    
         | 
| 
       16 
16 
     | 
    
         
             
                it "accepts valid values" do
         
     | 
| 
       17 
     | 
    
         
            -
                  [AIXM::Factory.xy].must_be_written_to subject, :center_xy
         
     | 
| 
      
 17 
     | 
    
         
            +
                  _([AIXM::Factory.xy]).must_be_written_to subject, :center_xy
         
     | 
| 
       18 
18 
     | 
    
         
             
                end
         
     | 
| 
       19 
19 
     | 
    
         
             
              end
         
     | 
| 
       20 
20 
     | 
    
         | 
| 
       21 
21 
     | 
    
         
             
              describe :radius= do
         
     | 
| 
       22 
22 
     | 
    
         
             
                it "fails on invalid values" do
         
     | 
| 
       23 
     | 
    
         
            -
                  [nil, 0, 2, AIXM.d(0, :m)].wont_be_written_to subject, :radius
         
     | 
| 
      
 23 
     | 
    
         
            +
                  _([nil, 0, 2, AIXM.d(0, :m)]).wont_be_written_to subject, :radius
         
     | 
| 
       24 
24 
     | 
    
         
             
                end
         
     | 
| 
       25 
25 
     | 
    
         
             
              end
         
     | 
| 
       26 
26 
     | 
    
         | 
| 
       27 
27 
     | 
    
         
             
              describe :north_xy do
         
     | 
| 
       28 
28 
     | 
    
         
             
                it "must calculate approximation of northmost point on the circumference" do
         
     | 
| 
       29 
     | 
    
         
            -
                  subject.send(:north_xy).must_equal AIXM.xy(lat: 12.25835483455868, long: -23.12345678)
         
     | 
| 
      
 29 
     | 
    
         
            +
                  _(subject.send(:north_xy)).must_equal AIXM.xy(lat: 12.25835483455868, long: -23.12345678)
         
     | 
| 
       30 
30 
     | 
    
         
             
                end
         
     | 
| 
       31 
31 
     | 
    
         
             
              end
         
     | 
| 
       32 
32 
     | 
    
         | 
| 
         @@ -36,8 +36,7 @@ describe AIXM::Component::Geometry::Circle do 
     | 
|
| 
       36 
36 
     | 
    
         
             
                    center_xy: AIXM.xy(lat: 11.1, long: 22.2),
         
     | 
| 
       37 
37 
     | 
    
         
             
                    radius: AIXM.d(25, :km)
         
     | 
| 
       38 
38 
     | 
    
         
             
                  )
         
     | 
| 
       39 
     | 
    
         
            -
                   
     | 
| 
       40 
     | 
    
         
            -
                  subject.to_xml.must_equal <<~END
         
     | 
| 
      
 39 
     | 
    
         
            +
                  _(subject.to_xml).must_equal <<~END
         
     | 
| 
       41 
40 
     | 
    
         
             
                    <Avx>
         
     | 
| 
       42 
41 
     | 
    
         
             
                      <codeType>CWA</codeType>
         
     | 
| 
       43 
42 
     | 
    
         
             
                      <geoLat>111929.39N</geoLat>
         
     | 
| 
         @@ -54,8 +53,7 @@ describe AIXM::Component::Geometry::Circle do 
     | 
|
| 
       54 
53 
     | 
    
         
             
                    center_xy: AIXM.xy(lat: -0.0005, long: -22.2),
         
     | 
| 
       55 
54 
     | 
    
         
             
                    radius: AIXM.d(50, :km)
         
     | 
| 
       56 
55 
     | 
    
         
             
                  )
         
     | 
| 
       57 
     | 
    
         
            -
                   
     | 
| 
       58 
     | 
    
         
            -
                  subject.to_xml.must_equal <<~END
         
     | 
| 
      
 56 
     | 
    
         
            +
                  _(subject.to_xml).must_equal <<~END
         
     | 
| 
       59 
57 
     | 
    
         
             
                    <Avx>
         
     | 
| 
       60 
58 
     | 
    
         
             
                      <codeType>CWA</codeType>
         
     | 
| 
       61 
59 
     | 
    
         
             
                      <geoLat>002656.98N</geoLat>
         
     | 
| 
         @@ -12,8 +12,7 @@ describe AIXM::Component::Geometry::Point do 
     | 
|
| 
       12 
12 
     | 
    
         
             
              describe :to_xml do
         
     | 
| 
       13 
13 
     | 
    
         
             
                it "builds correct AIXM for N/E points" do
         
     | 
| 
       14 
14 
     | 
    
         
             
                  subject = AIXM.point(xy: AIXM.xy(lat: 11.1, long: 22.2))
         
     | 
| 
       15 
     | 
    
         
            -
                   
     | 
| 
       16 
     | 
    
         
            -
                  subject.to_xml.must_equal <<~END
         
     | 
| 
      
 15 
     | 
    
         
            +
                  _(subject.to_xml).must_equal <<~END
         
     | 
| 
       17 
16 
     | 
    
         
             
                    <Avx>
         
     | 
| 
       18 
17 
     | 
    
         
             
                      <codeType>GRC</codeType>
         
     | 
| 
       19 
18 
     | 
    
         
             
                      <geoLat>110600.00N</geoLat>
         
     | 
| 
         @@ -25,8 +24,7 @@ describe AIXM::Component::Geometry::Point do 
     | 
|
| 
       25 
24 
     | 
    
         | 
| 
       26 
25 
     | 
    
         
             
                it "builds correct AIXM for S/W points" do
         
     | 
| 
       27 
26 
     | 
    
         
             
                  subject = AIXM.point(xy: AIXM.xy(lat: -11.1, long: -22.2))
         
     | 
| 
       28 
     | 
    
         
            -
                   
     | 
| 
       29 
     | 
    
         
            -
                  subject.to_xml.must_equal <<~END
         
     | 
| 
      
 27 
     | 
    
         
            +
                  _(subject.to_xml).must_equal <<~END
         
     | 
| 
       30 
28 
     | 
    
         
             
                    <Avx>
         
     | 
| 
       31 
29 
     | 
    
         
             
                      <codeType>GRC</codeType>
         
     | 
| 
       32 
30 
     | 
    
         
             
                      <geoLat>110600.00S</geoLat>
         
     | 
| 
         @@ -7,14 +7,14 @@ describe AIXM::Component::Geometry do 
     | 
|
| 
       7 
7 
     | 
    
         
             
                end
         
     | 
| 
       8 
8 
     | 
    
         | 
| 
       9 
9 
     | 
    
         
             
                it "must fail checks" do
         
     | 
| 
       10 
     | 
    
         
            -
                  subject.wont_be :point?
         
     | 
| 
       11 
     | 
    
         
            -
                  subject.wont_be :circle?
         
     | 
| 
       12 
     | 
    
         
            -
                  subject.wont_be :polygon?
         
     | 
| 
       13 
     | 
    
         
            -
                  subject.wont_be :closed?
         
     | 
| 
      
 10 
     | 
    
         
            +
                  _(subject).wont_be :point?
         
     | 
| 
      
 11 
     | 
    
         
            +
                  _(subject).wont_be :circle?
         
     | 
| 
      
 12 
     | 
    
         
            +
                  _(subject).wont_be :polygon?
         
     | 
| 
      
 13 
     | 
    
         
            +
                  _(subject).wont_be :closed?
         
     | 
| 
       14 
14 
     | 
    
         
             
                end
         
     | 
| 
       15 
15 
     | 
    
         | 
| 
       16 
16 
     | 
    
         
             
                it "must fail to build AIXM" do
         
     | 
| 
       17 
     | 
    
         
            -
                   
     | 
| 
      
 17 
     | 
    
         
            +
                  _{ subject.to_xml }.must_raise AIXM::GeometryError
         
     | 
| 
       18 
18 
     | 
    
         
             
                end
         
     | 
| 
       19 
19 
     | 
    
         
             
              end
         
     | 
| 
       20 
20 
     | 
    
         | 
| 
         @@ -26,19 +26,18 @@ describe AIXM::Component::Geometry do 
     | 
|
| 
       26 
26 
     | 
    
         
             
                end
         
     | 
| 
       27 
27 
     | 
    
         | 
| 
       28 
28 
     | 
    
         
             
                it "must pass checks" do
         
     | 
| 
       29 
     | 
    
         
            -
                  subject.must_be :point?
         
     | 
| 
       30 
     | 
    
         
            -
                  subject.wont_be :circle?
         
     | 
| 
       31 
     | 
    
         
            -
                  subject.wont_be :polygon?
         
     | 
| 
       32 
     | 
    
         
            -
                  subject.must_be :closed?
         
     | 
| 
      
 29 
     | 
    
         
            +
                  _(subject).must_be :point?
         
     | 
| 
      
 30 
     | 
    
         
            +
                  _(subject).wont_be :circle?
         
     | 
| 
      
 31 
     | 
    
         
            +
                  _(subject).wont_be :polygon?
         
     | 
| 
      
 32 
     | 
    
         
            +
                  _(subject).must_be :closed?
         
     | 
| 
       33 
33 
     | 
    
         
             
                end
         
     | 
| 
       34 
34 
     | 
    
         | 
| 
       35 
35 
     | 
    
         
             
                it "must return elements" do
         
     | 
| 
       36 
     | 
    
         
            -
                  subject.segments.count.must_equal 1
         
     | 
| 
      
 36 
     | 
    
         
            +
                  _(subject.segments.count).must_equal 1
         
     | 
| 
       37 
37 
     | 
    
         
             
                end
         
     | 
| 
       38 
38 
     | 
    
         | 
| 
       39 
39 
     | 
    
         
             
                it "builds valid AIXM" do
         
     | 
| 
       40 
     | 
    
         
            -
                   
     | 
| 
       41 
     | 
    
         
            -
                  subject.to_xml.must_equal <<~END
         
     | 
| 
      
 40 
     | 
    
         
            +
                  _(subject.to_xml).must_equal <<~END
         
     | 
| 
       42 
41 
     | 
    
         
             
                    <Avx>
         
     | 
| 
       43 
42 
     | 
    
         
             
                      <codeType>GRC</codeType>
         
     | 
| 
       44 
43 
     | 
    
         
             
                      <geoLat>110000.00N</geoLat>
         
     | 
| 
         @@ -58,14 +57,14 @@ describe AIXM::Component::Geometry do 
     | 
|
| 
       58 
57 
     | 
    
         
             
                end
         
     | 
| 
       59 
58 
     | 
    
         | 
| 
       60 
59 
     | 
    
         
             
                it "must fail checks" do
         
     | 
| 
       61 
     | 
    
         
            -
                  subject.wont_be :point?
         
     | 
| 
       62 
     | 
    
         
            -
                  subject.wont_be :circle?
         
     | 
| 
       63 
     | 
    
         
            -
                  subject.wont_be :polygon?
         
     | 
| 
       64 
     | 
    
         
            -
                  subject.wont_be :closed?
         
     | 
| 
      
 60 
     | 
    
         
            +
                  _(subject).wont_be :point?
         
     | 
| 
      
 61 
     | 
    
         
            +
                  _(subject).wont_be :circle?
         
     | 
| 
      
 62 
     | 
    
         
            +
                  _(subject).wont_be :polygon?
         
     | 
| 
      
 63 
     | 
    
         
            +
                  _(subject).wont_be :closed?
         
     | 
| 
       65 
64 
     | 
    
         
             
                end
         
     | 
| 
       66 
65 
     | 
    
         | 
| 
       67 
66 
     | 
    
         
             
                it "must fail to build AIXM" do
         
     | 
| 
       68 
     | 
    
         
            -
                   
     | 
| 
      
 67 
     | 
    
         
            +
                  _{ subject.to_xml }.must_raise AIXM::GeometryError
         
     | 
| 
       69 
68 
     | 
    
         
             
                end
         
     | 
| 
       70 
69 
     | 
    
         
             
              end
         
     | 
| 
       71 
70 
     | 
    
         | 
| 
         @@ -80,19 +79,18 @@ describe AIXM::Component::Geometry do 
     | 
|
| 
       80 
79 
     | 
    
         
             
                end
         
     | 
| 
       81 
80 
     | 
    
         | 
| 
       82 
81 
     | 
    
         
             
                it "must pass checks" do
         
     | 
| 
       83 
     | 
    
         
            -
                  subject.wont_be :point?
         
     | 
| 
       84 
     | 
    
         
            -
                  subject.wont_be :circle?
         
     | 
| 
       85 
     | 
    
         
            -
                  subject.must_be :polygon?
         
     | 
| 
       86 
     | 
    
         
            -
                  subject.must_be :closed?
         
     | 
| 
      
 82 
     | 
    
         
            +
                  _(subject).wont_be :point?
         
     | 
| 
      
 83 
     | 
    
         
            +
                  _(subject).wont_be :circle?
         
     | 
| 
      
 84 
     | 
    
         
            +
                  _(subject).must_be :polygon?
         
     | 
| 
      
 85 
     | 
    
         
            +
                  _(subject).must_be :closed?
         
     | 
| 
       87 
86 
     | 
    
         
             
                end
         
     | 
| 
       88 
87 
     | 
    
         | 
| 
       89 
88 
     | 
    
         
             
                it "must return elements" do
         
     | 
| 
       90 
     | 
    
         
            -
                  subject.segments.count.must_equal 4
         
     | 
| 
      
 89 
     | 
    
         
            +
                  _(subject.segments.count).must_equal 4
         
     | 
| 
       91 
90 
     | 
    
         
             
                end
         
     | 
| 
       92 
91 
     | 
    
         | 
| 
       93 
92 
     | 
    
         
             
                it "builds valid AIXM" do
         
     | 
| 
       94 
     | 
    
         
            -
                   
     | 
| 
       95 
     | 
    
         
            -
                  subject.to_xml.must_equal <<~END
         
     | 
| 
      
 93 
     | 
    
         
            +
                  _(subject.to_xml).must_equal <<~END
         
     | 
| 
       96 
94 
     | 
    
         
             
                    <Avx>
         
     | 
| 
       97 
95 
     | 
    
         
             
                      <codeType>GRC</codeType>
         
     | 
| 
       98 
96 
     | 
    
         
             
                      <geoLat>110000.00N</geoLat>
         
     | 
| 
         @@ -131,14 +129,14 @@ describe AIXM::Component::Geometry do 
     | 
|
| 
       131 
129 
     | 
    
         
             
                end
         
     | 
| 
       132 
130 
     | 
    
         | 
| 
       133 
131 
     | 
    
         
             
                it "must fail checks" do
         
     | 
| 
       134 
     | 
    
         
            -
                  subject.wont_be :point?
         
     | 
| 
       135 
     | 
    
         
            -
                  subject.wont_be :circle?
         
     | 
| 
       136 
     | 
    
         
            -
                  subject.wont_be :polygon?
         
     | 
| 
       137 
     | 
    
         
            -
                  subject.wont_be :closed?
         
     | 
| 
      
 132 
     | 
    
         
            +
                  _(subject).wont_be :point?
         
     | 
| 
      
 133 
     | 
    
         
            +
                  _(subject).wont_be :circle?
         
     | 
| 
      
 134 
     | 
    
         
            +
                  _(subject).wont_be :polygon?
         
     | 
| 
      
 135 
     | 
    
         
            +
                  _(subject).wont_be :closed?
         
     | 
| 
       138 
136 
     | 
    
         
             
                end
         
     | 
| 
       139 
137 
     | 
    
         | 
| 
       140 
138 
     | 
    
         
             
                it "must fail to build AIXM" do
         
     | 
| 
       141 
     | 
    
         
            -
                   
     | 
| 
      
 139 
     | 
    
         
            +
                  _{ subject.to_xml }.must_raise AIXM::GeometryError
         
     | 
| 
       142 
140 
     | 
    
         
             
                end
         
     | 
| 
       143 
141 
     | 
    
         
             
              end
         
     | 
| 
       144 
142 
     | 
    
         | 
| 
         @@ -152,15 +150,14 @@ describe AIXM::Component::Geometry do 
     | 
|
| 
       152 
150 
     | 
    
         
             
                end
         
     | 
| 
       153 
151 
     | 
    
         | 
| 
       154 
152 
     | 
    
         
             
                it "must pass checks" do
         
     | 
| 
       155 
     | 
    
         
            -
                  subject.wont_be :point?
         
     | 
| 
       156 
     | 
    
         
            -
                  subject.wont_be :circle?
         
     | 
| 
       157 
     | 
    
         
            -
                  subject.must_be :polygon?
         
     | 
| 
       158 
     | 
    
         
            -
                  subject.must_be :closed?
         
     | 
| 
      
 153 
     | 
    
         
            +
                  _(subject).wont_be :point?
         
     | 
| 
      
 154 
     | 
    
         
            +
                  _(subject).wont_be :circle?
         
     | 
| 
      
 155 
     | 
    
         
            +
                  _(subject).must_be :polygon?
         
     | 
| 
      
 156 
     | 
    
         
            +
                  _(subject).must_be :closed?
         
     | 
| 
       159 
157 
     | 
    
         
             
                end
         
     | 
| 
       160 
158 
     | 
    
         | 
| 
       161 
159 
     | 
    
         
             
                it "builds valid AIXM" do
         
     | 
| 
       162 
     | 
    
         
            -
                   
     | 
| 
       163 
     | 
    
         
            -
                  subject.to_xml.must_equal <<~END
         
     | 
| 
      
 160 
     | 
    
         
            +
                  _(subject.to_xml).must_equal <<~END
         
     | 
| 
       164 
161 
     | 
    
         
             
                    <Avx>
         
     | 
| 
       165 
162 
     | 
    
         
             
                      <codeType>CWA</codeType>
         
     | 
| 
       166 
163 
     | 
    
         
             
                      <geoLat>110000.00N</geoLat>
         
     | 
| 
         @@ -194,14 +191,14 @@ describe AIXM::Component::Geometry do 
     | 
|
| 
       194 
191 
     | 
    
         
             
                end
         
     | 
| 
       195 
192 
     | 
    
         | 
| 
       196 
193 
     | 
    
         
             
                it "must fail checks" do
         
     | 
| 
       197 
     | 
    
         
            -
                  subject.wont_be :point?
         
     | 
| 
       198 
     | 
    
         
            -
                  subject.wont_be :circle?
         
     | 
| 
       199 
     | 
    
         
            -
                  subject.wont_be :polygon?
         
     | 
| 
       200 
     | 
    
         
            -
                  subject.wont_be :closed?
         
     | 
| 
      
 194 
     | 
    
         
            +
                  _(subject).wont_be :point?
         
     | 
| 
      
 195 
     | 
    
         
            +
                  _(subject).wont_be :circle?
         
     | 
| 
      
 196 
     | 
    
         
            +
                  _(subject).wont_be :polygon?
         
     | 
| 
      
 197 
     | 
    
         
            +
                  _(subject).wont_be :closed?
         
     | 
| 
       201 
198 
     | 
    
         
             
                end
         
     | 
| 
       202 
199 
     | 
    
         | 
| 
       203 
200 
     | 
    
         
             
                it "must fail to build AIXM" do
         
     | 
| 
       204 
     | 
    
         
            -
                   
     | 
| 
      
 201 
     | 
    
         
            +
                  _{ subject.to_xml }.must_raise AIXM::GeometryError
         
     | 
| 
       205 
202 
     | 
    
         
             
                end
         
     | 
| 
       206 
203 
     | 
    
         
             
              end
         
     | 
| 
       207 
204 
     | 
    
         | 
| 
         @@ -215,15 +212,14 @@ describe AIXM::Component::Geometry do 
     | 
|
| 
       215 
212 
     | 
    
         
             
                end
         
     | 
| 
       216 
213 
     | 
    
         | 
| 
       217 
214 
     | 
    
         
             
                it "must pass checks" do
         
     | 
| 
       218 
     | 
    
         
            -
                  subject.wont_be :point?
         
     | 
| 
       219 
     | 
    
         
            -
                  subject.wont_be :circle?
         
     | 
| 
       220 
     | 
    
         
            -
                  subject.must_be :polygon?
         
     | 
| 
       221 
     | 
    
         
            -
                  subject.must_be :closed?
         
     | 
| 
      
 215 
     | 
    
         
            +
                  _(subject).wont_be :point?
         
     | 
| 
      
 216 
     | 
    
         
            +
                  _(subject).wont_be :circle?
         
     | 
| 
      
 217 
     | 
    
         
            +
                  _(subject).must_be :polygon?
         
     | 
| 
      
 218 
     | 
    
         
            +
                  _(subject).must_be :closed?
         
     | 
| 
       222 
219 
     | 
    
         
             
                end
         
     | 
| 
       223 
220 
     | 
    
         | 
| 
       224 
221 
     | 
    
         
             
                it "builds valid AIXM" do
         
     | 
| 
       225 
     | 
    
         
            -
                   
     | 
| 
       226 
     | 
    
         
            -
                  subject.to_xml.must_equal <<~END
         
     | 
| 
      
 222 
     | 
    
         
            +
                  _(subject.to_xml).must_equal <<~END
         
     | 
| 
       227 
223 
     | 
    
         
             
                    <Avx>
         
     | 
| 
       228 
224 
     | 
    
         
             
                      <GbrUid>
         
     | 
| 
       229 
225 
     | 
    
         
             
                        <txtName>foobar</txtName>
         
     | 
| 
         @@ -258,14 +254,14 @@ describe AIXM::Component::Geometry do 
     | 
|
| 
       258 
254 
     | 
    
         
             
                end
         
     | 
| 
       259 
255 
     | 
    
         | 
| 
       260 
256 
     | 
    
         
             
                it "must fail checks" do
         
     | 
| 
       261 
     | 
    
         
            -
                  subject.wont_be :point?
         
     | 
| 
       262 
     | 
    
         
            -
                  subject.wont_be :circle?
         
     | 
| 
       263 
     | 
    
         
            -
                  subject.wont_be :polygon?
         
     | 
| 
       264 
     | 
    
         
            -
                  subject.wont_be :closed?
         
     | 
| 
      
 257 
     | 
    
         
            +
                  _(subject).wont_be :point?
         
     | 
| 
      
 258 
     | 
    
         
            +
                  _(subject).wont_be :circle?
         
     | 
| 
      
 259 
     | 
    
         
            +
                  _(subject).wont_be :polygon?
         
     | 
| 
      
 260 
     | 
    
         
            +
                  _(subject).wont_be :closed?
         
     | 
| 
       265 
261 
     | 
    
         
             
                end
         
     | 
| 
       266 
262 
     | 
    
         | 
| 
       267 
263 
     | 
    
         
             
                it "must fail to build AIXM" do
         
     | 
| 
       268 
     | 
    
         
            -
                   
     | 
| 
      
 264 
     | 
    
         
            +
                  _{ subject.to_xml }.must_raise AIXM::GeometryError
         
     | 
| 
       269 
265 
     | 
    
         
             
                end
         
     | 
| 
       270 
266 
     | 
    
         
             
              end
         
     | 
| 
       271 
267 
     | 
    
         | 
| 
         @@ -277,15 +273,14 @@ describe AIXM::Component::Geometry do 
     | 
|
| 
       277 
273 
     | 
    
         
             
                end
         
     | 
| 
       278 
274 
     | 
    
         | 
| 
       279 
275 
     | 
    
         
             
                it "must pass checks" do
         
     | 
| 
       280 
     | 
    
         
            -
                  subject.wont_be :point?
         
     | 
| 
       281 
     | 
    
         
            -
                  subject.must_be :circle?
         
     | 
| 
       282 
     | 
    
         
            -
                  subject.wont_be :polygon?
         
     | 
| 
       283 
     | 
    
         
            -
                  subject.must_be :closed?
         
     | 
| 
      
 276 
     | 
    
         
            +
                  _(subject).wont_be :point?
         
     | 
| 
      
 277 
     | 
    
         
            +
                  _(subject).must_be :circle?
         
     | 
| 
      
 278 
     | 
    
         
            +
                  _(subject).wont_be :polygon?
         
     | 
| 
      
 279 
     | 
    
         
            +
                  _(subject).must_be :closed?
         
     | 
| 
       284 
280 
     | 
    
         
             
                end
         
     | 
| 
       285 
281 
     | 
    
         | 
| 
       286 
282 
     | 
    
         
             
                it "builds valid AIXM" do
         
     | 
| 
       287 
     | 
    
         
            -
                   
     | 
| 
       288 
     | 
    
         
            -
                  subject.to_xml.must_equal <<~END
         
     | 
| 
      
 283 
     | 
    
         
            +
                  _(subject.to_xml).must_equal <<~END
         
     | 
| 
       289 
284 
     | 
    
         
             
                    <Avx>
         
     | 
| 
       290 
285 
     | 
    
         
             
                      <codeType>CWA</codeType>
         
     | 
| 
       291 
286 
     | 
    
         
             
                      <geoLat>110523.76N</geoLat>
         
     | 
| 
         @@ -307,14 +302,14 @@ describe AIXM::Component::Geometry do 
     | 
|
| 
       307 
302 
     | 
    
         
             
                end
         
     | 
| 
       308 
303 
     | 
    
         | 
| 
       309 
304 
     | 
    
         
             
                it "must fail checks when additional elements are present" do
         
     | 
| 
       310 
     | 
    
         
            -
                  subject.wont_be :point?
         
     | 
| 
       311 
     | 
    
         
            -
                  subject.wont_be :circle?
         
     | 
| 
       312 
     | 
    
         
            -
                  subject.wont_be :polygon?
         
     | 
| 
       313 
     | 
    
         
            -
                  subject.wont_be :closed?
         
     | 
| 
      
 305 
     | 
    
         
            +
                  _(subject).wont_be :point?
         
     | 
| 
      
 306 
     | 
    
         
            +
                  _(subject).wont_be :circle?
         
     | 
| 
      
 307 
     | 
    
         
            +
                  _(subject).wont_be :polygon?
         
     | 
| 
      
 308 
     | 
    
         
            +
                  _(subject).wont_be :closed?
         
     | 
| 
       314 
309 
     | 
    
         
             
                end
         
     | 
| 
       315 
310 
     | 
    
         | 
| 
       316 
311 
     | 
    
         
             
                it "must fail to build AIXM" do
         
     | 
| 
       317 
     | 
    
         
            -
                   
     | 
| 
      
 312 
     | 
    
         
            +
                  _{ subject.to_xml }.must_raise AIXM::GeometryError
         
     | 
| 
       318 
313 
     | 
    
         
             
                end
         
     | 
| 
       319 
314 
     | 
    
         
             
              end
         
     | 
| 
       320 
315 
     | 
    
         |