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
 
| 
         @@ -7,11 +7,11 @@ describe AIXM::Component::Helipad do 
     | 
|
| 
       7 
7 
     | 
    
         | 
| 
       8 
8 
     | 
    
         
             
              describe :name= do
         
     | 
| 
       9 
9 
     | 
    
         
             
                it "fails on invalid values" do
         
     | 
| 
       10 
     | 
    
         
            -
                  [nil, :foobar, 123].wont_be_written_to subject, :name
         
     | 
| 
      
 10 
     | 
    
         
            +
                  _([nil, :foobar, 123]).wont_be_written_to subject, :name
         
     | 
| 
       11 
11 
     | 
    
         
             
                end
         
     | 
| 
       12 
12 
     | 
    
         | 
| 
       13 
13 
     | 
    
         
             
                it "upcases and transcodes valid values" do
         
     | 
| 
       14 
     | 
    
         
            -
                  subject.tap { |s| s.name = 'h1' }.name.must_equal 'H1'
         
     | 
| 
      
 14 
     | 
    
         
            +
                  _(subject.tap { |s| s.name = 'h1' }.name).must_equal 'H1'
         
     | 
| 
       15 
15 
     | 
    
         
             
                end
         
     | 
| 
       16 
16 
     | 
    
         
             
              end
         
     | 
| 
       17 
17 
     | 
    
         | 
| 
         @@ -19,7 +19,7 @@ describe AIXM::Component::Helipad do 
     | 
|
| 
       19 
19 
     | 
    
         
             
                macro :xy
         
     | 
| 
       20 
20 
     | 
    
         | 
| 
       21 
21 
     | 
    
         
             
                it "fails on nil value" do
         
     | 
| 
       22 
     | 
    
         
            -
                  [nil].wont_be_written_to subject, :xy
         
     | 
| 
      
 22 
     | 
    
         
            +
                  _([nil]).wont_be_written_to subject, :xy
         
     | 
| 
       23 
23 
     | 
    
         
             
                end
         
     | 
| 
       24 
24 
     | 
    
         
             
              end
         
     | 
| 
       25 
25 
     | 
    
         | 
| 
         @@ -29,21 +29,21 @@ describe AIXM::Component::Helipad do 
     | 
|
| 
       29 
29 
     | 
    
         | 
| 
       30 
30 
     | 
    
         
             
              describe :length= do
         
     | 
| 
       31 
31 
     | 
    
         
             
                it "fails on invalid values" do
         
     | 
| 
       32 
     | 
    
         
            -
                  [:foobar, 0, 1, AIXM.d(0, :m)].wont_be_written_to subject, :length
         
     | 
| 
      
 32 
     | 
    
         
            +
                  _([:foobar, 0, 1, AIXM.d(0, :m)]).wont_be_written_to subject, :length
         
     | 
| 
       33 
33 
     | 
    
         
             
                end
         
     | 
| 
       34 
34 
     | 
    
         | 
| 
       35 
35 
     | 
    
         
             
                it "accepts nil value" do
         
     | 
| 
       36 
     | 
    
         
            -
                  [nil].must_be_written_to subject, :length
         
     | 
| 
      
 36 
     | 
    
         
            +
                  _([nil]).must_be_written_to subject, :length
         
     | 
| 
       37 
37 
     | 
    
         
             
                end
         
     | 
| 
       38 
38 
     | 
    
         
             
              end
         
     | 
| 
       39 
39 
     | 
    
         | 
| 
       40 
40 
     | 
    
         
             
              describe :width= do
         
     | 
| 
       41 
41 
     | 
    
         
             
                it "fails on invalid values" do
         
     | 
| 
       42 
     | 
    
         
            -
                  [:foobar, 0, 1, AIXM.d(0, :m)].wont_be_written_to subject, :width
         
     | 
| 
      
 42 
     | 
    
         
            +
                  _([:foobar, 0, 1, AIXM.d(0, :m)]).wont_be_written_to subject, :width
         
     | 
| 
       43 
43 
     | 
    
         
             
                end
         
     | 
| 
       44 
44 
     | 
    
         | 
| 
       45 
45 
     | 
    
         
             
                it "accepts nil value" do
         
     | 
| 
       46 
     | 
    
         
            -
                  [nil].must_be_written_to subject, :width
         
     | 
| 
      
 46 
     | 
    
         
            +
                  _([nil]).must_be_written_to subject, :width
         
     | 
| 
       47 
47 
     | 
    
         
             
                end
         
     | 
| 
       48 
48 
     | 
    
         
             
              end
         
     | 
| 
       49 
49 
     | 
    
         | 
| 
         @@ -53,41 +53,41 @@ describe AIXM::Component::Helipad do 
     | 
|
| 
       53 
53 
     | 
    
         | 
| 
       54 
54 
     | 
    
         
             
              describe :fato= do
         
     | 
| 
       55 
55 
     | 
    
         
             
                it "fails on invalid values" do
         
     | 
| 
       56 
     | 
    
         
            -
                  [:foobar, 0].wont_be_written_to subject, :fato
         
     | 
| 
      
 56 
     | 
    
         
            +
                  _([:foobar, 0]).wont_be_written_to subject, :fato
         
     | 
| 
       57 
57 
     | 
    
         
             
                end
         
     | 
| 
       58 
58 
     | 
    
         | 
| 
       59 
59 
     | 
    
         
             
                it "accepts valid values" do
         
     | 
| 
       60 
     | 
    
         
            -
                  [nil, AIXM::Factory.fato].must_be_written_to subject, :fato
         
     | 
| 
      
 60 
     | 
    
         
            +
                  _([nil, AIXM::Factory.fato]).must_be_written_to subject, :fato
         
     | 
| 
       61 
61 
     | 
    
         
             
                end
         
     | 
| 
       62 
62 
     | 
    
         
             
              end
         
     | 
| 
       63 
63 
     | 
    
         | 
| 
       64 
64 
     | 
    
         
             
              describe :helicopter_class= do
         
     | 
| 
       65 
65 
     | 
    
         
             
                it "fails on invalid values" do
         
     | 
| 
       66 
     | 
    
         
            -
                  [:foobar, 123].wont_be_written_to subject, :helicopter_class
         
     | 
| 
      
 66 
     | 
    
         
            +
                  _([:foobar, 123]).wont_be_written_to subject, :helicopter_class
         
     | 
| 
       67 
67 
     | 
    
         
             
                end
         
     | 
| 
       68 
68 
     | 
    
         | 
| 
       69 
69 
     | 
    
         
             
                it "accepts nil value" do
         
     | 
| 
       70 
     | 
    
         
            -
                  [nil].must_be_written_to subject, :helicopter_class
         
     | 
| 
      
 70 
     | 
    
         
            +
                  _([nil]).must_be_written_to subject, :helicopter_class
         
     | 
| 
       71 
71 
     | 
    
         
             
                end
         
     | 
| 
       72 
72 
     | 
    
         | 
| 
       73 
73 
     | 
    
         
             
                it "looks up valid values" do
         
     | 
| 
       74 
     | 
    
         
            -
                  subject.tap { |s| s.helicopter_class = 1 }.helicopter_class.must_equal :'1'
         
     | 
| 
       75 
     | 
    
         
            -
                  subject.tap { |s| s.helicopter_class = :OTHER }.helicopter_class.must_equal :other
         
     | 
| 
      
 74 
     | 
    
         
            +
                  _(subject.tap { |s| s.helicopter_class = 1 }.helicopter_class).must_equal :'1'
         
     | 
| 
      
 75 
     | 
    
         
            +
                  _(subject.tap { |s| s.helicopter_class = :OTHER }.helicopter_class).must_equal :other
         
     | 
| 
       76 
76 
     | 
    
         
             
                end
         
     | 
| 
       77 
77 
     | 
    
         
             
              end
         
     | 
| 
       78 
78 
     | 
    
         | 
| 
       79 
79 
     | 
    
         
             
              describe :status= do
         
     | 
| 
       80 
80 
     | 
    
         
             
                it "fails on invalid values" do
         
     | 
| 
       81 
     | 
    
         
            -
                  [:foobar, 123].wont_be_written_to subject, :status
         
     | 
| 
      
 81 
     | 
    
         
            +
                  _([:foobar, 123]).wont_be_written_to subject, :status
         
     | 
| 
       82 
82 
     | 
    
         
             
                end
         
     | 
| 
       83 
83 
     | 
    
         | 
| 
       84 
84 
     | 
    
         
             
                it "accepts nil value" do
         
     | 
| 
       85 
     | 
    
         
            -
                  [nil].must_be_written_to subject, :status
         
     | 
| 
      
 85 
     | 
    
         
            +
                  _([nil]).must_be_written_to subject, :status
         
     | 
| 
       86 
86 
     | 
    
         
             
                end
         
     | 
| 
       87 
87 
     | 
    
         | 
| 
       88 
88 
     | 
    
         
             
                it "looks up valid values" do
         
     | 
| 
       89 
     | 
    
         
            -
                  subject.tap { |s| s.status = :closed }.status.must_equal :closed
         
     | 
| 
       90 
     | 
    
         
            -
                  subject.tap { |s| s.status = :SPOWER }.status.must_equal :secondary_power
         
     | 
| 
      
 89 
     | 
    
         
            +
                  _(subject.tap { |s| s.status = :closed }.status).must_equal :closed
         
     | 
| 
      
 90 
     | 
    
         
            +
                  _(subject.tap { |s| s.status = :SPOWER }.status).must_equal :secondary_power
         
     | 
| 
       91 
91 
     | 
    
         
             
                end
         
     | 
| 
       92 
92 
     | 
    
         
             
              end
         
     | 
| 
       93 
93 
     | 
    
         | 
| 
         @@ -98,7 +98,7 @@ describe AIXM::Component::Helipad do 
     | 
|
| 
       98 
98 
     | 
    
         
             
              describe :xml= do
         
     | 
| 
       99 
99 
     | 
    
         
             
                it "builds correct complete OFMX" do
         
     | 
| 
       100 
100 
     | 
    
         
             
                  AIXM.ofmx!
         
     | 
| 
       101 
     | 
    
         
            -
                  subject.to_xml.must_equal <<~END
         
     | 
| 
      
 101 
     | 
    
         
            +
                  _(subject.to_xml).must_equal <<~END
         
     | 
| 
       102 
102 
     | 
    
         
             
                    <Tla>
         
     | 
| 
       103 
103 
     | 
    
         
             
                      <TlaUid>
         
     | 
| 
       104 
104 
     | 
    
         
             
                        <AhpUid>
         
     | 
| 
         @@ -163,7 +163,7 @@ describe AIXM::Component::Helipad do 
     | 
|
| 
       163 
163 
     | 
    
         
             
                  %i(z length width helicopter_class marking status remarks).each { |a| subject.send(:"#{a}=", nil) }
         
     | 
| 
       164 
164 
     | 
    
         
             
                  %i(composition preparation condition pcn siwl_weight siwl_tire_pressure auw_weight remarks).each { |a| subject.surface.send(:"#{a}=", nil) }
         
     | 
| 
       165 
165 
     | 
    
         
             
                  subject.instance_eval { @lightings.clear }
         
     | 
| 
       166 
     | 
    
         
            -
                  subject.to_xml.must_equal <<~END
         
     | 
| 
      
 166 
     | 
    
         
            +
                  _(subject.to_xml).must_equal <<~END
         
     | 
| 
       167 
167 
     | 
    
         
             
                    <Tla>
         
     | 
| 
       168 
168 
     | 
    
         
             
                      <TlaUid>
         
     | 
| 
       169 
169 
     | 
    
         
             
                        <AhpUid>
         
     | 
| 
         @@ -183,5 +183,11 @@ describe AIXM::Component::Helipad do 
     | 
|
| 
       183 
183 
     | 
    
         
             
                    </Tla>
         
     | 
| 
       184 
184 
     | 
    
         
             
                  END
         
     | 
| 
       185 
185 
     | 
    
         
             
                end
         
     | 
| 
      
 186 
     | 
    
         
            +
             
     | 
| 
      
 187 
     | 
    
         
            +
                it "builds OFMX with mid" do
         
     | 
| 
      
 188 
     | 
    
         
            +
                  AIXM.ofmx!
         
     | 
| 
      
 189 
     | 
    
         
            +
                  AIXM.config.mid_region = 'LF'
         
     | 
| 
      
 190 
     | 
    
         
            +
                  _(subject.to_xml).must_match /<TlaUid mid="c1f675f9-ed0f-e52e-b117-f9fe6a00fe7c">/
         
     | 
| 
      
 191 
     | 
    
         
            +
                end
         
     | 
| 
       186 
192 
     | 
    
         
             
              end
         
     | 
| 
       187 
193 
     | 
    
         
             
            end
         
     | 
| 
         @@ -9,48 +9,48 @@ describe AIXM::Component::Layer do 
     | 
|
| 
       9 
9 
     | 
    
         | 
| 
       10 
10 
     | 
    
         
             
                describe :initialize do
         
     | 
| 
       11 
11 
     | 
    
         
             
                  it "sets defaults" do
         
     | 
| 
       12 
     | 
    
         
            -
                    subject.wont_be :selective?
         
     | 
| 
      
 12 
     | 
    
         
            +
                    _(subject).wont_be :selective?
         
     | 
| 
       13 
13 
     | 
    
         
             
                  end
         
     | 
| 
       14 
14 
     | 
    
         
             
                end
         
     | 
| 
       15 
15 
     | 
    
         | 
| 
       16 
16 
     | 
    
         
             
                describe :class= do
         
     | 
| 
       17 
17 
     | 
    
         
             
                  it "fails on invalid values" do
         
     | 
| 
       18 
     | 
    
         
            -
                    [:X, 'X'].wont_be_written_to subject, :class
         
     | 
| 
      
 18 
     | 
    
         
            +
                    _([:X, 'X']).wont_be_written_to subject, :class
         
     | 
| 
       19 
19 
     | 
    
         
             
                  end
         
     | 
| 
       20 
20 
     | 
    
         | 
| 
       21 
21 
     | 
    
         
             
                  it "symbolizes and upcases valid values" do
         
     | 
| 
       22 
     | 
    
         
            -
                    subject.tap { |s| s.class = 'c' }.class.must_equal :C
         
     | 
| 
      
 22 
     | 
    
         
            +
                    _(subject.tap { |s| s.class = 'c' }.class).must_equal :C
         
     | 
| 
       23 
23 
     | 
    
         
             
                  end
         
     | 
| 
       24 
24 
     | 
    
         
             
                end
         
     | 
| 
       25 
25 
     | 
    
         | 
| 
       26 
26 
     | 
    
         
             
                describe :location_indicator= do
         
     | 
| 
       27 
27 
     | 
    
         
             
                  it "fails on invalid values" do
         
     | 
| 
       28 
     | 
    
         
            -
                    [:foobar, 123, 'XXX', 'XXXXX'].wont_be_written_to subject, :location_indicator
         
     | 
| 
      
 28 
     | 
    
         
            +
                    _([:foobar, 123, 'XXX', 'XXXXX']).wont_be_written_to subject, :location_indicator
         
     | 
| 
       29 
29 
     | 
    
         
             
                  end
         
     | 
| 
       30 
30 
     | 
    
         | 
| 
       31 
31 
     | 
    
         
             
                  it "accepts nil value" do
         
     | 
| 
       32 
     | 
    
         
            -
                    [nil].must_be_written_to subject, :location_indicator
         
     | 
| 
      
 32 
     | 
    
         
            +
                    _([nil]).must_be_written_to subject, :location_indicator
         
     | 
| 
       33 
33 
     | 
    
         
             
                  end
         
     | 
| 
       34 
34 
     | 
    
         | 
| 
       35 
35 
     | 
    
         
             
                  it "upcases value" do
         
     | 
| 
       36 
     | 
    
         
            -
                    subject.tap { |s| s.location_indicator = 'lfbb' }.location_indicator.must_equal 'LFBB'
         
     | 
| 
      
 36 
     | 
    
         
            +
                    _(subject.tap { |s| s.location_indicator = 'lfbb' }.location_indicator).must_equal 'LFBB'
         
     | 
| 
       37 
37 
     | 
    
         
             
                  end
         
     | 
| 
       38 
38 
     | 
    
         
             
                end
         
     | 
| 
       39 
39 
     | 
    
         | 
| 
       40 
40 
     | 
    
         
             
                describe :vertical_limits= do
         
     | 
| 
       41 
41 
     | 
    
         
             
                  it "fails on invalid values" do
         
     | 
| 
       42 
     | 
    
         
            -
                    [nil, :foobar, 123].wont_be_written_to subject, :vertical_limits
         
     | 
| 
      
 42 
     | 
    
         
            +
                    _([nil, :foobar, 123]).wont_be_written_to subject, :vertical_limits
         
     | 
| 
       43 
43 
     | 
    
         
             
                  end
         
     | 
| 
       44 
44 
     | 
    
         
             
                end
         
     | 
| 
       45 
45 
     | 
    
         | 
| 
       46 
46 
     | 
    
         
             
                describe :activity= do
         
     | 
| 
       47 
47 
     | 
    
         
             
                  it "fails on invalid values" do
         
     | 
| 
       48 
     | 
    
         
            -
                    [:foobar, 123].wont_be_written_to subject, :activity
         
     | 
| 
      
 48 
     | 
    
         
            +
                    _([:foobar, 123]).wont_be_written_to subject, :activity
         
     | 
| 
       49 
49 
     | 
    
         
             
                  end
         
     | 
| 
       50 
50 
     | 
    
         | 
| 
       51 
51 
     | 
    
         
             
                  it "looks up valid values" do
         
     | 
| 
       52 
     | 
    
         
            -
                    subject.tap { |s| s.activity = :aerodrome_traffic }.activity.must_equal :aerodrome_traffic
         
     | 
| 
       53 
     | 
    
         
            -
                    subject.tap { |s| s.activity = :GLIDER }.activity.must_equal :gliding
         
     | 
| 
      
 52 
     | 
    
         
            +
                    _(subject.tap { |s| s.activity = :aerodrome_traffic }.activity).must_equal :aerodrome_traffic
         
     | 
| 
      
 53 
     | 
    
         
            +
                    _(subject.tap { |s| s.activity = :GLIDER }.activity).must_equal :gliding
         
     | 
| 
       54 
54 
     | 
    
         
             
                  end
         
     | 
| 
       55 
55 
     | 
    
         
             
                end
         
     | 
| 
       56 
56 
     | 
    
         | 
| 
         @@ -60,7 +60,7 @@ describe AIXM::Component::Layer do 
     | 
|
| 
       60 
60 
     | 
    
         | 
| 
       61 
61 
     | 
    
         
             
                describe :selective= do
         
     | 
| 
       62 
62 
     | 
    
         
             
                  it "fails on invalid values" do
         
     | 
| 
       63 
     | 
    
         
            -
                    [nil, 'N', 0].wont_be_written_to subject, :selective
         
     | 
| 
      
 63 
     | 
    
         
            +
                    _([nil, 'N', 0]).wont_be_written_to subject, :selective
         
     | 
| 
       64 
64 
     | 
    
         
             
                  end
         
     | 
| 
       65 
65 
     | 
    
         
             
                end
         
     | 
| 
       66 
66 
     | 
    
         | 
| 
         @@ -71,7 +71,7 @@ describe AIXM::Component::Layer do 
     | 
|
| 
       71 
71 
     | 
    
         
             
                describe :to_xml do
         
     | 
| 
       72 
72 
     | 
    
         
             
                  it "builds correct OFMX" do
         
     | 
| 
       73 
73 
     | 
    
         
             
                    AIXM.ofmx!
         
     | 
| 
       74 
     | 
    
         
            -
                    subject.to_xml.must_equal <<~END
         
     | 
| 
      
 74 
     | 
    
         
            +
                    _(subject.to_xml).must_equal <<~END
         
     | 
| 
       75 
75 
     | 
    
         
             
                      <codeDistVerUpper>STD</codeDistVerUpper>
         
     | 
| 
       76 
76 
     | 
    
         
             
                      <valDistVerUpper>65</valDistVerUpper>
         
     | 
| 
       77 
77 
     | 
    
         
             
                      <uomDistVerUpper>FL</uomDistVerUpper>
         
     | 
| 
         @@ -89,10 +89,9 @@ describe AIXM::Component::Layer do 
     | 
|
| 
       89 
89 
     | 
    
         
             
                  end
         
     | 
| 
       90 
90 
     | 
    
         | 
| 
       91 
91 
     | 
    
         
             
                  it "builds correct AIXM" do
         
     | 
| 
       92 
     | 
    
         
            -
                     
     | 
| 
       93 
     | 
    
         
            -
                    subject.to_xml.wont_match(/< 
     | 
| 
       94 
     | 
    
         
            -
                    subject.to_xml.wont_match(/< 
     | 
| 
       95 
     | 
    
         
            -
                    subject.to_xml.wont_match(/<txtRmk>/)
         
     | 
| 
      
 92 
     | 
    
         
            +
                    _(subject.to_xml).wont_match(/<codeSelAvbl>/)
         
     | 
| 
      
 93 
     | 
    
         
            +
                    _(subject.to_xml).wont_match(/<Att>/)
         
     | 
| 
      
 94 
     | 
    
         
            +
                    _(subject.to_xml).wont_match(/<txtRmk>/)
         
     | 
| 
       96 
95 
     | 
    
         
             
                  end
         
     | 
| 
       97 
96 
     | 
    
         
             
                end
         
     | 
| 
       98 
97 
     | 
    
         
             
              end
         
     | 
| 
         @@ -104,7 +103,7 @@ describe AIXM::Component::Layer do 
     | 
|
| 
       104 
103 
     | 
    
         | 
| 
       105 
104 
     | 
    
         
             
                it "builds correct OFMX" do
         
     | 
| 
       106 
105 
     | 
    
         
             
                  AIXM.ofmx!
         
     | 
| 
       107 
     | 
    
         
            -
                  subject.to_xml.must_equal <<~END
         
     | 
| 
      
 106 
     | 
    
         
            +
                  _(subject.to_xml).must_equal <<~END
         
     | 
| 
       108 
107 
     | 
    
         
             
                    <codeClass>C</codeClass>
         
     | 
| 
       109 
108 
     | 
    
         
             
                    <codeLocInd>XXXX</codeLocInd>
         
     | 
| 
       110 
109 
     | 
    
         
             
                    <codeActivity>TFC-AD</codeActivity>
         
     | 
| 
         @@ -129,8 +128,7 @@ describe AIXM::Component::Layer do 
     | 
|
| 
       129 
128 
     | 
    
         
             
                end
         
     | 
| 
       130 
129 
     | 
    
         | 
| 
       131 
130 
     | 
    
         
             
                it "builds correct AIXM" do
         
     | 
| 
       132 
     | 
    
         
            -
                   
     | 
| 
       133 
     | 
    
         
            -
                  subject.to_xml.wont_match(/<codeSelAvbl>/)
         
     | 
| 
      
 131 
     | 
    
         
            +
                  _(subject.to_xml).wont_match(/<codeSelAvbl>/)
         
     | 
| 
       134 
132 
     | 
    
         
             
                end
         
     | 
| 
       135 
133 
     | 
    
         
             
              end
         
     | 
| 
       136 
134 
     | 
    
         | 
| 
         @@ -7,53 +7,53 @@ describe AIXM::Component::Lighting do 
     | 
|
| 
       7 
7 
     | 
    
         | 
| 
       8 
8 
     | 
    
         
             
              describe :position= do
         
     | 
| 
       9 
9 
     | 
    
         
             
                it "fails on invalid values" do
         
     | 
| 
       10 
     | 
    
         
            -
                  [:foobar, 123, nil].wont_be_written_to subject, :position
         
     | 
| 
      
 10 
     | 
    
         
            +
                  _([:foobar, 123, nil]).wont_be_written_to subject, :position
         
     | 
| 
       11 
11 
     | 
    
         
             
                end
         
     | 
| 
       12 
12 
     | 
    
         | 
| 
       13 
13 
     | 
    
         
             
                it "looks up valid values" do
         
     | 
| 
       14 
     | 
    
         
            -
                  subject.tap { |s| s.position = :edge }.position.must_equal :edge
         
     | 
| 
       15 
     | 
    
         
            -
                  subject.tap { |s| s.position = :SWYEND }.position.must_equal :stopway_end
         
     | 
| 
      
 14 
     | 
    
         
            +
                  _(subject.tap { |s| s.position = :edge }.position).must_equal :edge
         
     | 
| 
      
 15 
     | 
    
         
            +
                  _(subject.tap { |s| s.position = :SWYEND }.position).must_equal :stopway_end
         
     | 
| 
       16 
16 
     | 
    
         
             
                end
         
     | 
| 
       17 
17 
     | 
    
         
             
              end
         
     | 
| 
       18 
18 
     | 
    
         | 
| 
       19 
19 
     | 
    
         
             
              describe :description= do
         
     | 
| 
       20 
20 
     | 
    
         
             
                it "accepts nil value" do
         
     | 
| 
       21 
     | 
    
         
            -
                  [nil].must_be_written_to subject, :description
         
     | 
| 
      
 21 
     | 
    
         
            +
                  _([nil]).must_be_written_to subject, :description
         
     | 
| 
       22 
22 
     | 
    
         
             
                end
         
     | 
| 
       23 
23 
     | 
    
         | 
| 
       24 
24 
     | 
    
         
             
                it "stringifies valid values" do
         
     | 
| 
       25 
     | 
    
         
            -
                  subject.tap { |s| s.description = 'foobar' }.description.must_equal 'foobar'
         
     | 
| 
       26 
     | 
    
         
            -
                  subject.tap { |s| s.description = 123 }.description.must_equal '123'
         
     | 
| 
      
 25 
     | 
    
         
            +
                  _(subject.tap { |s| s.description = 'foobar' }.description).must_equal 'foobar'
         
     | 
| 
      
 26 
     | 
    
         
            +
                  _(subject.tap { |s| s.description = 123 }.description).must_equal '123'
         
     | 
| 
       27 
27 
     | 
    
         
             
                end
         
     | 
| 
       28 
28 
     | 
    
         
             
              end
         
     | 
| 
       29 
29 
     | 
    
         | 
| 
       30 
30 
     | 
    
         
             
              describe :intensity= do
         
     | 
| 
       31 
31 
     | 
    
         
             
                it "fails on invalid values" do
         
     | 
| 
       32 
     | 
    
         
            -
                  [:foobar, 123].wont_be_written_to subject, :intensity
         
     | 
| 
      
 32 
     | 
    
         
            +
                  _([:foobar, 123]).wont_be_written_to subject, :intensity
         
     | 
| 
       33 
33 
     | 
    
         
             
                end
         
     | 
| 
       34 
34 
     | 
    
         | 
| 
       35 
35 
     | 
    
         
             
                it "accepts nil value" do
         
     | 
| 
       36 
     | 
    
         
            -
                  [nil].must_be_written_to subject, :intensity
         
     | 
| 
      
 36 
     | 
    
         
            +
                  _([nil]).must_be_written_to subject, :intensity
         
     | 
| 
       37 
37 
     | 
    
         
             
                end
         
     | 
| 
       38 
38 
     | 
    
         | 
| 
       39 
39 
     | 
    
         
             
                it "looks up valid values" do
         
     | 
| 
       40 
     | 
    
         
            -
                  subject.tap { |s| s.intensity = :low }.intensity.must_equal :low
         
     | 
| 
       41 
     | 
    
         
            -
                  subject.tap { |s| s.intensity = 'LIM' }.intensity.must_equal :medium
         
     | 
| 
      
 40 
     | 
    
         
            +
                  _(subject.tap { |s| s.intensity = :low }.intensity).must_equal :low
         
     | 
| 
      
 41 
     | 
    
         
            +
                  _(subject.tap { |s| s.intensity = 'LIM' }.intensity).must_equal :medium
         
     | 
| 
       42 
42 
     | 
    
         
             
                end
         
     | 
| 
       43 
43 
     | 
    
         
             
              end
         
     | 
| 
       44 
44 
     | 
    
         | 
| 
       45 
45 
     | 
    
         
             
              describe :color= do
         
     | 
| 
       46 
46 
     | 
    
         
             
                it "fails on invalid values" do
         
     | 
| 
       47 
     | 
    
         
            -
                  [:foobar, 123].wont_be_written_to subject, :color
         
     | 
| 
      
 47 
     | 
    
         
            +
                  _([:foobar, 123]).wont_be_written_to subject, :color
         
     | 
| 
       48 
48 
     | 
    
         
             
                end
         
     | 
| 
       49 
49 
     | 
    
         | 
| 
       50 
50 
     | 
    
         
             
                it "accepts nil value" do
         
     | 
| 
       51 
     | 
    
         
            -
                  [nil].must_be_written_to subject, :color
         
     | 
| 
      
 51 
     | 
    
         
            +
                  _([nil]).must_be_written_to subject, :color
         
     | 
| 
       52 
52 
     | 
    
         
             
                end
         
     | 
| 
       53 
53 
     | 
    
         | 
| 
       54 
54 
     | 
    
         
             
                it "looks up valid values" do
         
     | 
| 
       55 
     | 
    
         
            -
                  subject.tap { |s| s.color = :blue }.color.must_equal :blue
         
     | 
| 
       56 
     | 
    
         
            -
                  subject.tap { |s| s.color = 'GRN' }.color.must_equal :green
         
     | 
| 
      
 55 
     | 
    
         
            +
                  _(subject.tap { |s| s.color = :blue }.color).must_equal :blue
         
     | 
| 
      
 56 
     | 
    
         
            +
                  _(subject.tap { |s| s.color = 'GRN' }.color).must_equal :green
         
     | 
| 
       57 
57 
     | 
    
         
             
                end
         
     | 
| 
       58 
58 
     | 
    
         
             
              end
         
     | 
| 
       59 
59 
     | 
    
         | 
| 
         @@ -63,7 +63,7 @@ describe AIXM::Component::Lighting do 
     | 
|
| 
       63 
63 
     | 
    
         | 
| 
       64 
64 
     | 
    
         
             
              describe :to_xml do
         
     | 
| 
       65 
65 
     | 
    
         
             
                it "builds correct complete AIXM/OFMX" do
         
     | 
| 
       66 
     | 
    
         
            -
                  subject.to_xml(as: :Rls).must_equal <<~END
         
     | 
| 
      
 66 
     | 
    
         
            +
                  _(subject.to_xml(as: :Rls)).must_equal <<~END
         
     | 
| 
       67 
67 
     | 
    
         
             
                    <Rls>
         
     | 
| 
       68 
68 
     | 
    
         
             
                      <RlsUid>
         
     | 
| 
       69 
69 
     | 
    
         
             
                        <RdnUid>
         
     | 
| 
         @@ -84,5 +84,11 @@ describe AIXM::Component::Lighting do 
     | 
|
| 
       84 
84 
     | 
    
         
             
                    </Rls>
         
     | 
| 
       85 
85 
     | 
    
         
             
                  END
         
     | 
| 
       86 
86 
     | 
    
         
             
                end
         
     | 
| 
      
 87 
     | 
    
         
            +
             
     | 
| 
      
 88 
     | 
    
         
            +
                it "builds OFMX with mid" do
         
     | 
| 
      
 89 
     | 
    
         
            +
                  AIXM.ofmx!
         
     | 
| 
      
 90 
     | 
    
         
            +
                  AIXM.config.mid_region = 'LF'
         
     | 
| 
      
 91 
     | 
    
         
            +
                  _(subject.to_xml(as: :Rls)).must_match /<RlsUid mid="e96565dc-d6b4-35ca-6e42-7c465cfbec52">/
         
     | 
| 
      
 92 
     | 
    
         
            +
                end
         
     | 
| 
       87 
93 
     | 
    
         
             
              end
         
     | 
| 
       88 
94 
     | 
    
         
             
            end
         
     | 
| 
         @@ -7,63 +7,63 @@ describe AIXM::Component::Runway do 
     | 
|
| 
       7 
7 
     | 
    
         | 
| 
       8 
8 
     | 
    
         
             
              describe :initialize do
         
     | 
| 
       9 
9 
     | 
    
         
             
                it "sets defaults for bidirectional runways" do
         
     | 
| 
       10 
     | 
    
         
            -
                  subject.forth.name.must_equal AIXM.a('16L')
         
     | 
| 
       11 
     | 
    
         
            -
                  subject.back.name.must_equal AIXM.a('34R')
         
     | 
| 
      
 10 
     | 
    
         
            +
                  _(subject.forth.name).must_equal AIXM.a('16L')
         
     | 
| 
      
 11 
     | 
    
         
            +
                  _(subject.back.name).must_equal AIXM.a('34R')
         
     | 
| 
       12 
12 
     | 
    
         
             
                end
         
     | 
| 
       13 
13 
     | 
    
         | 
| 
       14 
14 
     | 
    
         
             
                it "sets defaults for unidirectional runways" do
         
     | 
| 
       15 
15 
     | 
    
         
             
                  subject = AIXM::Component::Runway.new(name: '30')
         
     | 
| 
       16 
     | 
    
         
            -
                  subject.forth.name.must_equal AIXM.a('30')
         
     | 
| 
       17 
     | 
    
         
            -
                  subject.back.must_be_nil
         
     | 
| 
      
 16 
     | 
    
         
            +
                  _(subject.forth.name).must_equal AIXM.a('30')
         
     | 
| 
      
 17 
     | 
    
         
            +
                  _(subject.back).must_be_nil
         
     | 
| 
       18 
18 
     | 
    
         
             
                end
         
     | 
| 
       19 
19 
     | 
    
         | 
| 
       20 
20 
     | 
    
         
             
                it "fails on non-inverse bidirectional runways" do
         
     | 
| 
       21 
     | 
    
         
            -
                   
     | 
| 
      
 21 
     | 
    
         
            +
                  _{ AIXM.runway(name: '16L/14R') }.must_raise ArgumentError
         
     | 
| 
       22 
22 
     | 
    
         
             
                end
         
     | 
| 
       23 
23 
     | 
    
         
             
              end
         
     | 
| 
       24 
24 
     | 
    
         | 
| 
       25 
25 
     | 
    
         
             
              describe :name= do
         
     | 
| 
       26 
26 
     | 
    
         
             
                it "fails on invalid values" do
         
     | 
| 
       27 
     | 
    
         
            -
                  [nil, :foobar, 123].wont_be_written_to subject, :name
         
     | 
| 
      
 27 
     | 
    
         
            +
                  _([nil, :foobar, 123]).wont_be_written_to subject, :name
         
     | 
| 
       28 
28 
     | 
    
         
             
                end
         
     | 
| 
       29 
29 
     | 
    
         | 
| 
       30 
30 
     | 
    
         
             
                it "upcases and transcodes valid values" do
         
     | 
| 
       31 
     | 
    
         
            -
                  subject.tap { |s| s.name = '10r/28l' }.name.must_equal '10R/28L'
         
     | 
| 
      
 31 
     | 
    
         
            +
                  _(subject.tap { |s| s.name = '10r/28l' }.name).must_equal '10R/28L'
         
     | 
| 
       32 
32 
     | 
    
         
             
                end
         
     | 
| 
       33 
33 
     | 
    
         
             
              end
         
     | 
| 
       34 
34 
     | 
    
         | 
| 
       35 
35 
     | 
    
         
             
              describe :length= do
         
     | 
| 
       36 
36 
     | 
    
         
             
                it "fails on invalid values" do
         
     | 
| 
       37 
     | 
    
         
            -
                  [:foobar, 0, 1, AIXM.d(0, :m)].wont_be_written_to subject, :length
         
     | 
| 
      
 37 
     | 
    
         
            +
                  _([:foobar, 0, 1, AIXM.d(0, :m)]).wont_be_written_to subject, :length
         
     | 
| 
       38 
38 
     | 
    
         
             
                end
         
     | 
| 
       39 
39 
     | 
    
         | 
| 
       40 
40 
     | 
    
         
             
                it "accepts nil value" do
         
     | 
| 
       41 
     | 
    
         
            -
                  [nil].must_be_written_to subject, :length
         
     | 
| 
      
 41 
     | 
    
         
            +
                  _([nil]).must_be_written_to subject, :length
         
     | 
| 
       42 
42 
     | 
    
         
             
                end
         
     | 
| 
       43 
43 
     | 
    
         
             
              end
         
     | 
| 
       44 
44 
     | 
    
         | 
| 
       45 
45 
     | 
    
         
             
              describe :width= do
         
     | 
| 
       46 
46 
     | 
    
         
             
                it "fails on invalid values" do
         
     | 
| 
       47 
     | 
    
         
            -
                  [:foobar, 0, 1, AIXM.d(0, :m)].wont_be_written_to subject, :width
         
     | 
| 
      
 47 
     | 
    
         
            +
                  _([:foobar, 0, 1, AIXM.d(0, :m)]).wont_be_written_to subject, :width
         
     | 
| 
       48 
48 
     | 
    
         
             
                end
         
     | 
| 
       49 
49 
     | 
    
         | 
| 
       50 
50 
     | 
    
         
             
                it "accepts nil value" do
         
     | 
| 
       51 
     | 
    
         
            -
                  [nil].must_be_written_to subject, :width
         
     | 
| 
      
 51 
     | 
    
         
            +
                  _([nil]).must_be_written_to subject, :width
         
     | 
| 
       52 
52 
     | 
    
         
             
                end
         
     | 
| 
       53 
53 
     | 
    
         
             
              end
         
     | 
| 
       54 
54 
     | 
    
         | 
| 
       55 
55 
     | 
    
         
             
              describe :status= do
         
     | 
| 
       56 
56 
     | 
    
         
             
                it "fails on invalid values" do
         
     | 
| 
       57 
     | 
    
         
            -
                  [:foobar, 123].wont_be_written_to subject, :status
         
     | 
| 
      
 57 
     | 
    
         
            +
                  _([:foobar, 123]).wont_be_written_to subject, :status
         
     | 
| 
       58 
58 
     | 
    
         
             
                end
         
     | 
| 
       59 
59 
     | 
    
         | 
| 
       60 
60 
     | 
    
         
             
                it "accepts nil value" do
         
     | 
| 
       61 
     | 
    
         
            -
                  [nil].must_be_written_to subject, :status
         
     | 
| 
      
 61 
     | 
    
         
            +
                  _([nil]).must_be_written_to subject, :status
         
     | 
| 
       62 
62 
     | 
    
         
             
                end
         
     | 
| 
       63 
63 
     | 
    
         | 
| 
       64 
64 
     | 
    
         
             
                it "looks up valid values" do
         
     | 
| 
       65 
     | 
    
         
            -
                  subject.tap { |s| s.status = :closed }.status.must_equal :closed
         
     | 
| 
       66 
     | 
    
         
            -
                  subject.tap { |s| s.status = :SPOWER }.status.must_equal :secondary_power
         
     | 
| 
      
 65 
     | 
    
         
            +
                  _(subject.tap { |s| s.status = :closed }.status).must_equal :closed
         
     | 
| 
      
 66 
     | 
    
         
            +
                  _(subject.tap { |s| s.status = :SPOWER }.status).must_equal :secondary_power
         
     | 
| 
       67 
67 
     | 
    
         
             
                end
         
     | 
| 
       68 
68 
     | 
    
         
             
              end
         
     | 
| 
       69 
69 
     | 
    
         | 
| 
         @@ -74,7 +74,7 @@ describe AIXM::Component::Runway do 
     | 
|
| 
       74 
74 
     | 
    
         
             
              describe :xml= do
         
     | 
| 
       75 
75 
     | 
    
         
             
                it "builds correct complete OFMX" do
         
     | 
| 
       76 
76 
     | 
    
         
             
                  AIXM.ofmx!
         
     | 
| 
       77 
     | 
    
         
            -
                  subject.to_xml.must_equal <<~END
         
     | 
| 
      
 77 
     | 
    
         
            +
                  _(subject.to_xml).must_equal <<~END
         
     | 
| 
       78 
78 
     | 
    
         
             
                    <Rwy>
         
     | 
| 
       79 
79 
     | 
    
         
             
                      <RwyUid>
         
     | 
| 
       80 
80 
     | 
    
         
             
                        <AhpUid>
         
     | 
| 
         @@ -116,7 +116,7 @@ describe AIXM::Component::Runway do 
     | 
|
| 
       116 
116 
     | 
    
         
             
                      <geoLat>44.00211944N</geoLat>
         
     | 
| 
       117 
117 
     | 
    
         
             
                      <geoLong>004.75216944E</geoLong>
         
     | 
| 
       118 
118 
     | 
    
         
             
                      <valTrueBrg>165</valTrueBrg>
         
     | 
| 
       119 
     | 
    
         
            -
                      <valMagBrg> 
     | 
| 
      
 119 
     | 
    
         
            +
                      <valMagBrg>164</valMagBrg>
         
     | 
| 
       120 
120 
     | 
    
         
             
                      <valElevTdz>145</valElevTdz>
         
     | 
| 
       121 
121 
     | 
    
         
             
                      <uomElevTdz>FT</uomElevTdz>
         
     | 
| 
       122 
122 
     | 
    
         
             
                      <codeVfrPattern>E</codeVfrPattern>
         
     | 
| 
         @@ -171,7 +171,7 @@ describe AIXM::Component::Runway do 
     | 
|
| 
       171 
171 
     | 
    
         
             
                      <geoLat>43.99036389N</geoLat>
         
     | 
| 
       172 
172 
     | 
    
         
             
                      <geoLong>004.75645556E</geoLong>
         
     | 
| 
       173 
173 
     | 
    
         
             
                      <valTrueBrg>345</valTrueBrg>
         
     | 
| 
       174 
     | 
    
         
            -
                      <valMagBrg> 
     | 
| 
      
 174 
     | 
    
         
            +
                      <valMagBrg>344</valMagBrg>
         
     | 
| 
       175 
175 
     | 
    
         
             
                      <valElevTdz>147</valElevTdz>
         
     | 
| 
       176 
176 
     | 
    
         
             
                      <uomElevTdz>FT</uomElevTdz>
         
     | 
| 
       177 
177 
     | 
    
         
             
                      <codeVfrPattern>L</codeVfrPattern>
         
     | 
| 
         @@ -221,7 +221,7 @@ describe AIXM::Component::Runway do 
     | 
|
| 
       221 
221 
     | 
    
         
             
                  %i(length width status remarks).each { |a| subject.send(:"#{a}=", nil) }
         
     | 
| 
       222 
222 
     | 
    
         
             
                  %i(composition preparation condition pcn siwl_weight siwl_tire_pressure auw_weight remarks).each { |a| subject.surface.send(:"#{a}=", nil) }
         
     | 
| 
       223 
223 
     | 
    
         
             
                  %i(forth back).each { |d| subject.send(d).instance_eval { @lightings.clear } }
         
     | 
| 
       224 
     | 
    
         
            -
                  subject.to_xml.must_equal <<~END
         
     | 
| 
      
 224 
     | 
    
         
            +
                  _(subject.to_xml).must_equal <<~END
         
     | 
| 
       225 
225 
     | 
    
         
             
                    <Rwy>
         
     | 
| 
       226 
226 
     | 
    
         
             
                      <RwyUid>
         
     | 
| 
       227 
227 
     | 
    
         
             
                        <AhpUid>
         
     | 
| 
         @@ -243,7 +243,7 @@ describe AIXM::Component::Runway do 
     | 
|
| 
       243 
243 
     | 
    
         
             
                      <geoLat>44.00211944N</geoLat>
         
     | 
| 
       244 
244 
     | 
    
         
             
                      <geoLong>004.75216944E</geoLong>
         
     | 
| 
       245 
245 
     | 
    
         
             
                      <valTrueBrg>165</valTrueBrg>
         
     | 
| 
       246 
     | 
    
         
            -
                      <valMagBrg> 
     | 
| 
      
 246 
     | 
    
         
            +
                      <valMagBrg>164</valMagBrg>
         
     | 
| 
       247 
247 
     | 
    
         
             
                      <valElevTdz>145</valElevTdz>
         
     | 
| 
       248 
248 
     | 
    
         
             
                      <uomElevTdz>FT</uomElevTdz>
         
     | 
| 
       249 
249 
     | 
    
         
             
                      <codeVfrPattern>E</codeVfrPattern>
         
     | 
| 
         @@ -280,7 +280,7 @@ describe AIXM::Component::Runway do 
     | 
|
| 
       280 
280 
     | 
    
         
             
                      <geoLat>43.99036389N</geoLat>
         
     | 
| 
       281 
281 
     | 
    
         
             
                      <geoLong>004.75645556E</geoLong>
         
     | 
| 
       282 
282 
     | 
    
         
             
                      <valTrueBrg>345</valTrueBrg>
         
     | 
| 
       283 
     | 
    
         
            -
                      <valMagBrg> 
     | 
| 
      
 283 
     | 
    
         
            +
                      <valMagBrg>344</valMagBrg>
         
     | 
| 
       284 
284 
     | 
    
         
             
                      <valElevTdz>147</valElevTdz>
         
     | 
| 
       285 
285 
     | 
    
         
             
                      <uomElevTdz>FT</uomElevTdz>
         
     | 
| 
       286 
286 
     | 
    
         
             
                      <codeVfrPattern>L</codeVfrPattern>
         
     | 
| 
         @@ -306,6 +306,13 @@ describe AIXM::Component::Runway do 
     | 
|
| 
       306 
306 
     | 
    
         
             
                    </Rdd>
         
     | 
| 
       307 
307 
     | 
    
         
             
                  END
         
     | 
| 
       308 
308 
     | 
    
         
             
                end
         
     | 
| 
      
 309 
     | 
    
         
            +
             
     | 
| 
      
 310 
     | 
    
         
            +
                it "builds OFMX with mid" do
         
     | 
| 
      
 311 
     | 
    
         
            +
                  AIXM.ofmx!
         
     | 
| 
      
 312 
     | 
    
         
            +
                  AIXM.config.mid_region = 'LF'
         
     | 
| 
      
 313 
     | 
    
         
            +
                  _(subject.to_xml).must_match /<RwyUid mid="4d06b33a-91c8-ffec-ac25-b2b7efa103b2">/
         
     | 
| 
      
 314 
     | 
    
         
            +
                  _(subject.to_xml).must_match /<RdnUid mid="7e469f8c-b03a-9d1d-0e5a-2a2cec7c652d">/      
         
     | 
| 
      
 315 
     | 
    
         
            +
                end
         
     | 
| 
       309 
316 
     | 
    
         
             
              end
         
     | 
| 
       310 
317 
     | 
    
         
             
            end
         
     | 
| 
       311 
318 
     | 
    
         | 
| 
         @@ -316,19 +323,19 @@ describe AIXM::Component::Runway::Direction do 
     | 
|
| 
       316 
323 
     | 
    
         | 
| 
       317 
324 
     | 
    
         
             
              describe :name= do
         
     | 
| 
       318 
325 
     | 
    
         
             
                it "fails on invalid values" do
         
     | 
| 
       319 
     | 
    
         
            -
                  [nil, :foobar, '16R'].wont_be_written_to subject, :name
         
     | 
| 
      
 326 
     | 
    
         
            +
                  _([nil, :foobar, '16R']).wont_be_written_to subject, :name
         
     | 
| 
       320 
327 
     | 
    
         
             
                end
         
     | 
| 
       321 
328 
     | 
    
         | 
| 
       322 
329 
     | 
    
         
             
                it "overwrites preset name" do
         
     | 
| 
       323 
     | 
    
         
            -
                  subject.name.to_s.must_equal '16L'
         
     | 
| 
      
 330 
     | 
    
         
            +
                  _(subject.name.to_s).must_equal '16L'
         
     | 
| 
       324 
331 
     | 
    
         
             
                  subject.name = AIXM.a('34L')
         
     | 
| 
       325 
     | 
    
         
            -
                  subject.name.to_s.must_equal '34L'
         
     | 
| 
      
 332 
     | 
    
         
            +
                  _(subject.name.to_s).must_equal '34L'
         
     | 
| 
       326 
333 
     | 
    
         
             
                end
         
     | 
| 
       327 
334 
     | 
    
         
             
              end
         
     | 
| 
       328 
335 
     | 
    
         | 
| 
       329 
336 
     | 
    
         
             
              describe :geographic_orientation= do
         
     | 
| 
       330 
337 
     | 
    
         
             
                it "fails on invalid values" do
         
     | 
| 
       331 
     | 
    
         
            -
                  [:foobar, -1, 10].wont_be_written_to subject, :geographic_orientation
         
     | 
| 
      
 338 
     | 
    
         
            +
                  _([:foobar, -1, 10]).wont_be_written_to subject, :geographic_orientation
         
     | 
| 
       332 
339 
     | 
    
         
             
                end
         
     | 
| 
       333 
340 
     | 
    
         
             
              end
         
     | 
| 
       334 
341 
     | 
    
         | 
| 
         @@ -336,7 +343,7 @@ describe AIXM::Component::Runway::Direction do 
     | 
|
| 
       336 
343 
     | 
    
         
             
                macro :xy
         
     | 
| 
       337 
344 
     | 
    
         | 
| 
       338 
345 
     | 
    
         
             
                it "fails on nil value" do
         
     | 
| 
       339 
     | 
    
         
            -
                  [nil].wont_be_written_to subject, :xy
         
     | 
| 
      
 346 
     | 
    
         
            +
                  _([nil]).wont_be_written_to subject, :xy
         
     | 
| 
       340 
347 
     | 
    
         
             
                end
         
     | 
| 
       341 
348 
     | 
    
         
             
              end
         
     | 
| 
       342 
349 
     | 
    
         | 
| 
         @@ -344,34 +351,34 @@ describe AIXM::Component::Runway::Direction do 
     | 
|
| 
       344 
351 
     | 
    
         
             
                macro :z_qnh
         
     | 
| 
       345 
352 
     | 
    
         | 
| 
       346 
353 
     | 
    
         
             
                it "accepts nil value" do
         
     | 
| 
       347 
     | 
    
         
            -
                  [nil].must_be_written_to subject, :z
         
     | 
| 
      
 354 
     | 
    
         
            +
                  _([nil]).must_be_written_to subject, :z
         
     | 
| 
       348 
355 
     | 
    
         
             
                end
         
     | 
| 
       349 
356 
     | 
    
         
             
              end
         
     | 
| 
       350 
357 
     | 
    
         | 
| 
       351 
358 
     | 
    
         
             
              describe :displaced_threshold= do
         
     | 
| 
       352 
359 
     | 
    
         
             
                it "fails on invalid values" do
         
     | 
| 
       353 
     | 
    
         
            -
                  [:foobar, 1, AIXM.d(0, :m)].wont_be_written_to subject, :displaced_threshold
         
     | 
| 
      
 360 
     | 
    
         
            +
                  _([:foobar, 1, AIXM.d(0, :m)]).wont_be_written_to subject, :displaced_threshold
         
     | 
| 
       354 
361 
     | 
    
         
             
                end
         
     | 
| 
       355 
362 
     | 
    
         | 
| 
       356 
363 
     | 
    
         
             
                it "converts coordinates to distance" do
         
     | 
| 
       357 
364 
     | 
    
         
             
                  subject.xy = AIXM.xy(lat: %q(43°59'54.71"N), long: %q(004°45'28.35"E))
         
     | 
| 
       358 
365 
     | 
    
         
             
                  subject.displaced_threshold = AIXM.xy(lat: %q(43°59'48.47"N), long: %q(004°45'30.62"E))
         
     | 
| 
       359 
     | 
    
         
            -
                  subject.displaced_threshold.must_equal AIXM.d(199, :m)
         
     | 
| 
      
 366 
     | 
    
         
            +
                  _(subject.displaced_threshold).must_equal AIXM.d(199, :m)
         
     | 
| 
       360 
367 
     | 
    
         
             
                end
         
     | 
| 
       361 
368 
     | 
    
         
             
              end
         
     | 
| 
       362 
369 
     | 
    
         | 
| 
       363 
370 
     | 
    
         
             
              describe :vfr_pattern= do
         
     | 
| 
       364 
371 
     | 
    
         
             
                it "fails on invalid values" do
         
     | 
| 
       365 
     | 
    
         
            -
                  [:foobar, 123].wont_be_written_to subject, :vfr_pattern
         
     | 
| 
      
 372 
     | 
    
         
            +
                  _([:foobar, 123]).wont_be_written_to subject, :vfr_pattern
         
     | 
| 
       366 
373 
     | 
    
         
             
                end
         
     | 
| 
       367 
374 
     | 
    
         | 
| 
       368 
375 
     | 
    
         
             
                it "accepts nil value" do
         
     | 
| 
       369 
     | 
    
         
            -
                  [nil].must_be_written_to subject, :vfr_pattern
         
     | 
| 
      
 376 
     | 
    
         
            +
                  _([nil]).must_be_written_to subject, :vfr_pattern
         
     | 
| 
       370 
377 
     | 
    
         
             
                end
         
     | 
| 
       371 
378 
     | 
    
         | 
| 
       372 
379 
     | 
    
         
             
                it "looks up valid values" do
         
     | 
| 
       373 
     | 
    
         
            -
                  subject.tap { |s| s.vfr_pattern = :left }.vfr_pattern.must_equal :left
         
     | 
| 
       374 
     | 
    
         
            -
                  subject.tap { |s| s.vfr_pattern = :E }.vfr_pattern.must_equal :left_or_right
         
     | 
| 
      
 380 
     | 
    
         
            +
                  _(subject.tap { |s| s.vfr_pattern = :left }.vfr_pattern).must_equal :left
         
     | 
| 
      
 381 
     | 
    
         
            +
                  _(subject.tap { |s| s.vfr_pattern = :E }.vfr_pattern).must_equal :left_or_right
         
     | 
| 
       375 
382 
     | 
    
         
             
                end
         
     | 
| 
       376 
383 
     | 
    
         
             
              end
         
     | 
| 
       377 
384 
     | 
    
         | 
| 
         @@ -382,14 +389,14 @@ describe AIXM::Component::Runway::Direction do 
     | 
|
| 
       382 
389 
     | 
    
         
             
              describe :magnetic_orientation do
         
     | 
| 
       383 
390 
     | 
    
         
             
                it "is calculated correctly" do
         
     | 
| 
       384 
391 
     | 
    
         
             
                  subject.geographic_orientation = AIXM.a(16)
         
     | 
| 
       385 
     | 
    
         
            -
                  subject.magnetic_orientation.must_equal AIXM.a( 
     | 
| 
      
 392 
     | 
    
         
            +
                  _(subject.magnetic_orientation).must_equal AIXM.a(15)
         
     | 
| 
       386 
393 
     | 
    
         
             
                end
         
     | 
| 
       387 
394 
     | 
    
         
             
              end
         
     | 
| 
       388 
395 
     | 
    
         | 
| 
       389 
396 
     | 
    
         
             
              describe :xml= do
         
     | 
| 
       390 
397 
     | 
    
         
             
                it "builds correct complete OFMX" do
         
     | 
| 
       391 
398 
     | 
    
         
             
                  AIXM.ofmx!
         
     | 
| 
       392 
     | 
    
         
            -
                  subject.to_xml.must_equal <<~END
         
     | 
| 
      
 399 
     | 
    
         
            +
                  _(subject.to_xml).must_equal <<~END
         
     | 
| 
       393 
400 
     | 
    
         
             
                    <Rdn>
         
     | 
| 
       394 
401 
     | 
    
         
             
                      <RdnUid>
         
     | 
| 
       395 
402 
     | 
    
         
             
                        <RwyUid>
         
     | 
| 
         @@ -403,7 +410,7 @@ describe AIXM::Component::Runway::Direction do 
     | 
|
| 
       403 
410 
     | 
    
         
             
                      <geoLat>44.00211944N</geoLat>
         
     | 
| 
       404 
411 
     | 
    
         
             
                      <geoLong>004.75216944E</geoLong>
         
     | 
| 
       405 
412 
     | 
    
         
             
                      <valTrueBrg>165</valTrueBrg>
         
     | 
| 
       406 
     | 
    
         
            -
                      <valMagBrg> 
     | 
| 
      
 413 
     | 
    
         
            +
                      <valMagBrg>164</valMagBrg>
         
     | 
| 
       407 
414 
     | 
    
         
             
                      <valElevTdz>145</valElevTdz>
         
     | 
| 
       408 
415 
     | 
    
         
             
                      <uomElevTdz>FT</uomElevTdz>
         
     | 
| 
       409 
416 
     | 
    
         
             
                      <codeVfrPattern>E</codeVfrPattern>
         
     | 
| 
         @@ -452,7 +459,7 @@ describe AIXM::Component::Runway::Direction do 
     | 
|
| 
       452 
459 
     | 
    
         
             
                  AIXM.ofmx!
         
     | 
| 
       453 
460 
     | 
    
         
             
                  %i(geographic_orientation z displaced_threshold vfr_pattern remarks).each { |a| subject.send(:"#{a}=", nil) }
         
     | 
| 
       454 
461 
     | 
    
         
             
                  subject.instance_eval { @lightings.clear }
         
     | 
| 
       455 
     | 
    
         
            -
                  subject.to_xml.must_equal <<~END
         
     | 
| 
      
 462 
     | 
    
         
            +
                  _(subject.to_xml).must_equal <<~END
         
     | 
| 
       456 
463 
     | 
    
         
             
                    <Rdn>
         
     | 
| 
       457 
464 
     | 
    
         
             
                      <RdnUid>
         
     | 
| 
       458 
465 
     | 
    
         
             
                        <RwyUid>
         
     |