aixm 0.3.7 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/CHANGELOG.md +72 -6
  4. data/README.md +191 -53
  5. data/exe/ckmid +11 -0
  6. data/exe/mkmid +11 -0
  7. data/lib/aixm/association.rb +367 -0
  8. data/lib/aixm/classes.rb +44 -0
  9. data/lib/aixm/component/fato.rb +44 -52
  10. data/lib/aixm/component/frequency.rb +13 -14
  11. data/lib/aixm/component/geometry/arc.rb +2 -2
  12. data/lib/aixm/component/geometry/border.rb +14 -5
  13. data/lib/aixm/component/geometry/circle.rb +8 -2
  14. data/lib/aixm/component/geometry/point.rb +10 -3
  15. data/lib/aixm/component/geometry/rhumb_line.rb +54 -0
  16. data/lib/aixm/component/geometry.rb +38 -38
  17. data/lib/aixm/component/helipad.rb +29 -37
  18. data/lib/aixm/component/layer.rb +28 -19
  19. data/lib/aixm/component/lighting.rb +11 -12
  20. data/lib/aixm/component/runway.rb +46 -53
  21. data/lib/aixm/{feature → component}/service.rb +36 -35
  22. data/lib/aixm/component/surface.rb +3 -3
  23. data/lib/aixm/component/timetable.rb +5 -3
  24. data/lib/aixm/component/{vertical_limits.rb → vertical_limit.rb} +12 -6
  25. data/lib/aixm/config.rb +6 -3
  26. data/lib/aixm/document.rb +31 -49
  27. data/lib/aixm/executables.rb +85 -0
  28. data/lib/aixm/f.rb +28 -0
  29. data/lib/aixm/feature/address.rb +20 -15
  30. data/lib/aixm/feature/airport.rb +113 -129
  31. data/lib/aixm/feature/airspace.rb +54 -23
  32. data/lib/aixm/feature/navigational_aid/designated_point.rb +12 -14
  33. data/lib/aixm/feature/navigational_aid/dme.rb +10 -11
  34. data/lib/aixm/feature/navigational_aid/marker.rb +6 -2
  35. data/lib/aixm/feature/navigational_aid/ndb.rb +6 -2
  36. data/lib/aixm/feature/navigational_aid/tacan.rb +6 -2
  37. data/lib/aixm/feature/navigational_aid/vor.rb +22 -14
  38. data/lib/aixm/feature/navigational_aid.rb +7 -9
  39. data/lib/aixm/feature/obstacle.rb +22 -20
  40. data/lib/aixm/feature/obstacle_group.rb +30 -30
  41. data/lib/aixm/feature/organisation.rb +20 -4
  42. data/lib/aixm/feature/unit.rb +35 -45
  43. data/lib/aixm/feature.rb +13 -3
  44. data/lib/aixm/memoize.rb +89 -0
  45. data/lib/aixm/object.rb +9 -0
  46. data/lib/aixm/payload_hash.rb +114 -0
  47. data/lib/aixm/refinements.rb +34 -50
  48. data/lib/aixm/shortcuts.rb +6 -43
  49. data/lib/aixm/version.rb +1 -1
  50. data/lib/aixm/xy.rb +9 -1
  51. data/lib/aixm.rb +18 -7
  52. data/schemas/ofmx/{0 → 0.1}/OFMX-CSV-Obstacle.json +0 -0
  53. data/schemas/ofmx/{0 → 0.1}/OFMX-CSV.json +0 -0
  54. data/schemas/ofmx/{0 → 0.1}/OFMX-DataTypes.xsd +52 -2
  55. data/schemas/ofmx/{0 → 0.1}/OFMX-Features.xsd +225 -14
  56. data/schemas/ofmx/{0 → 0.1}/OFMX-Snapshot.xsd +0 -5
  57. data.tar.gz.sig +0 -0
  58. metadata +116 -164
  59. metadata.gz.sig +0 -0
  60. data/.gitignore +0 -6
  61. data/.ruby-version +0 -1
  62. data/.travis.yml +0 -8
  63. data/.yardopts +0 -3
  64. data/Guardfile +0 -8
  65. data/aixm.gemspec +0 -35
  66. data/gems.rb +0 -3
  67. data/lib/aixm/component.rb +0 -6
  68. data/rakefile.rb +0 -22
  69. data/spec/factory.rb +0 -559
  70. data/spec/lib/aixm/a_spec.rb +0 -203
  71. data/spec/lib/aixm/component/fato_spec.rb +0 -260
  72. data/spec/lib/aixm/component/frequency_spec.rb +0 -75
  73. data/spec/lib/aixm/component/geometry/arc_spec.rb +0 -75
  74. data/spec/lib/aixm/component/geometry/border_spec.rb +0 -33
  75. data/spec/lib/aixm/component/geometry/circle_spec.rb +0 -70
  76. data/spec/lib/aixm/component/geometry/point_spec.rb +0 -39
  77. data/spec/lib/aixm/component/geometry_spec.rb +0 -321
  78. data/spec/lib/aixm/component/helipad_spec.rb +0 -187
  79. data/spec/lib/aixm/component/layer_spec.rb +0 -137
  80. data/spec/lib/aixm/component/lighting_spec.rb +0 -88
  81. data/spec/lib/aixm/component/runway_spec.rb +0 -472
  82. data/spec/lib/aixm/component/surface_spec.rb +0 -124
  83. data/spec/lib/aixm/component/timetable_spec.rb +0 -49
  84. data/spec/lib/aixm/component/vertical_limits_spec.rb +0 -97
  85. data/spec/lib/aixm/config_spec.rb +0 -41
  86. data/spec/lib/aixm/d_spec.rb +0 -150
  87. data/spec/lib/aixm/document_spec.rb +0 -1875
  88. data/spec/lib/aixm/errors_spec.rb +0 -14
  89. data/spec/lib/aixm/f_spec.rb +0 -85
  90. data/spec/lib/aixm/feature/address_spec.rb +0 -55
  91. data/spec/lib/aixm/feature/airport_spec.rb +0 -770
  92. data/spec/lib/aixm/feature/airspace_spec.rb +0 -390
  93. data/spec/lib/aixm/feature/navigational_aid/designated_point_spec.rb +0 -98
  94. data/spec/lib/aixm/feature/navigational_aid/dme_spec.rb +0 -92
  95. data/spec/lib/aixm/feature/navigational_aid/marker_spec.rb +0 -79
  96. data/spec/lib/aixm/feature/navigational_aid/ndb_spec.rb +0 -89
  97. data/spec/lib/aixm/feature/navigational_aid/tacan_spec.rb +0 -88
  98. data/spec/lib/aixm/feature/navigational_aid/vor_spec.rb +0 -245
  99. data/spec/lib/aixm/feature/navigational_aid_spec.rb +0 -52
  100. data/spec/lib/aixm/feature/obstacle_group_spec.rb +0 -326
  101. data/spec/lib/aixm/feature/obstacle_spec.rb +0 -279
  102. data/spec/lib/aixm/feature/organisation_spec.rb +0 -77
  103. data/spec/lib/aixm/feature/service_spec.rb +0 -59
  104. data/spec/lib/aixm/feature/unit_spec.rb +0 -230
  105. data/spec/lib/aixm/feature_spec.rb +0 -38
  106. data/spec/lib/aixm/p_spec.rb +0 -189
  107. data/spec/lib/aixm/refinements_spec.rb +0 -381
  108. data/spec/lib/aixm/version_spec.rb +0 -7
  109. data/spec/lib/aixm/w_spec.rb +0 -150
  110. data/spec/lib/aixm/xy_spec.rb +0 -180
  111. data/spec/lib/aixm/z_spec.rb +0 -94
  112. data/spec/macros/marking.rb +0 -12
  113. data/spec/macros/organisation.rb +0 -11
  114. data/spec/macros/remarks.rb +0 -12
  115. data/spec/macros/timetable.rb +0 -11
  116. data/spec/macros/xy.rb +0 -11
  117. data/spec/macros/z_qnh.rb +0 -11
  118. data/spec/sounds/failure.mp3 +0 -0
  119. data/spec/sounds/success.mp3 +0 -0
  120. data/spec/spec_helper.rb +0 -55
@@ -1,89 +0,0 @@
1
- require_relative '../../../../spec_helper'
2
-
3
- describe AIXM::Feature::NavigationalAid::NDB do
4
- subject do
5
- AIXM::Factory.ndb
6
- end
7
-
8
- describe :type= do
9
- it "fails on invalid values" do
10
- [:foobar, 123].wont_be_written_to subject, :type
11
- end
12
-
13
- it "accepts nil value" do
14
- [nil].must_be_written_to subject, :type
15
- end
16
-
17
- it "looks up valid values" do
18
- subject.tap { |s| s.type = :en_route }.type.must_equal :en_route
19
- subject.tap { |s| s.type = :L }.type.must_equal :locator
20
- end
21
- end
22
-
23
- describe :f= do
24
- it "fails on invalid values" do
25
- [nil, :foobar, 123].wont_be_written_to subject, :f
26
- end
27
-
28
- it "accepts valid values" do
29
- [AIXM.f(200, :khz)].must_be_written_to subject, :f
30
- end
31
- end
32
-
33
- describe :kind do
34
- it "must return class/type combo" do
35
- subject.kind.must_equal "NDB:B"
36
- end
37
- end
38
-
39
- describe :to_xml do
40
- it "builds correct complete OFMX" do
41
- AIXM.ofmx!
42
- subject.to_xml.must_equal <<~END
43
- <!-- NavigationalAid: [NDB:B] NNN / NDB NAVAID -->
44
- <Ndb source="LF|GEN|0.0 FACTORY|0|0">
45
- <NdbUid>
46
- <codeId>NNN</codeId>
47
- <geoLat>47.85916667N</geoLat>
48
- <geoLong>007.56000000E</geoLong>
49
- </NdbUid>
50
- <OrgUid>
51
- <txtName>FRANCE</txtName>
52
- </OrgUid>
53
- <txtName>NDB NAVAID</txtName>
54
- <valFreq>555</valFreq>
55
- <uomFreq>KHZ</uomFreq>
56
- <codeClass>B</codeClass>
57
- <codeDatum>WGE</codeDatum>
58
- <valElev>500</valElev>
59
- <uomDistVer>FT</uomDistVer>
60
- <Ntt>
61
- <codeWorkHr>H24</codeWorkHr>
62
- </Ntt>
63
- <txtRmk>ndb navaid</txtRmk>
64
- </Ndb>
65
- END
66
- end
67
-
68
- it "builds correct minimal OFMX" do
69
- AIXM.ofmx!
70
- subject.name = subject.type = subject.z = subject.timetable = subject.remarks = nil
71
- subject.to_xml.must_equal <<~END
72
- <!-- NavigationalAid: [NDB] NNN -->
73
- <Ndb source="LF|GEN|0.0 FACTORY|0|0">
74
- <NdbUid>
75
- <codeId>NNN</codeId>
76
- <geoLat>47.85916667N</geoLat>
77
- <geoLong>007.56000000E</geoLong>
78
- </NdbUid>
79
- <OrgUid>
80
- <txtName>FRANCE</txtName>
81
- </OrgUid>
82
- <valFreq>555</valFreq>
83
- <uomFreq>KHZ</uomFreq>
84
- <codeDatum>WGE</codeDatum>
85
- </Ndb>
86
- END
87
- end
88
- end
89
- end
@@ -1,88 +0,0 @@
1
- require_relative '../../../../spec_helper'
2
-
3
- describe AIXM::Feature::NavigationalAid::TACAN do
4
- subject do
5
- AIXM::Factory.tacan
6
- end
7
-
8
- describe :channel= do
9
- it "fails on invalid values" do
10
- [nil, :foobar, 123, '0X', '127Y', '12Z'].wont_be_written_to subject, :channel
11
- end
12
- end
13
-
14
- describe :ghost_f do
15
- it "must be derived from the channel" do
16
- subject.tap { |s| s.channel = '1X' }.ghost_f.freq.must_equal 134.4
17
- subject.tap { |s| s.channel = '12Y' }.ghost_f.freq.must_equal 135.55
18
- subject.tap { |s| s.channel = '16Y' }.ghost_f.freq.must_equal 135.95
19
- subject.tap { |s| s.channel = '17X' }.ghost_f.freq.must_equal 108
20
- subject.tap { |s| s.channel = '30X' }.ghost_f.freq.must_equal 109.3
21
- subject.tap { |s| s.channel = '59Y' }.ghost_f.freq.must_equal 112.25
22
- subject.tap { |s| s.channel = '60X' }.ghost_f.freq.must_equal 133.3
23
- subject.tap { |s| s.channel = '64Y' }.ghost_f.freq.must_equal 133.75
24
- subject.tap { |s| s.channel = '69Y' }.ghost_f.freq.must_equal 134.25
25
- subject.tap { |s| s.channel = '70X' }.ghost_f.freq.must_equal 112.30
26
- subject.tap { |s| s.channel = '100X' }.ghost_f.freq.must_equal 115.3
27
- subject.tap { |s| s.channel = '126Y' }.ghost_f.freq.must_equal 117.95
28
- end
29
- end
30
-
31
- describe :kind do
32
- it "must return class/type combo" do
33
- subject.kind.must_equal "TACAN"
34
- end
35
- end
36
-
37
- describe :to_xml do
38
- it "builds correct complete OFMX" do
39
- AIXM.ofmx!
40
- subject.to_xml.must_equal <<~END
41
- <!-- NavigationalAid: [TACAN] TTT / TACAN NAVAID -->
42
- <Tcn source="LF|GEN|0.0 FACTORY|0|0">
43
- <TcnUid>
44
- <codeId>TTT</codeId>
45
- <geoLat>47.85916667N</geoLat>
46
- <geoLong>007.56000000E</geoLong>
47
- </TcnUid>
48
- <OrgUid>
49
- <txtName>FRANCE</txtName>
50
- </OrgUid>
51
- <txtName>TACAN NAVAID</txtName>
52
- <codeChannel>29X</codeChannel>
53
- <valGhostFreq>109.2</valGhostFreq>
54
- <uomGhostFreq>MHZ</uomGhostFreq>
55
- <codeDatum>WGE</codeDatum>
56
- <valElev>500</valElev>
57
- <uomDistVer>FT</uomDistVer>
58
- <Ttt>
59
- <codeWorkHr>H24</codeWorkHr>
60
- </Ttt>
61
- <txtRmk>tacan navaid</txtRmk>
62
- </Tcn>
63
- END
64
- end
65
-
66
- it "builds correct minimal OFMX" do
67
- AIXM.ofmx!
68
- subject.name = subject.z = subject.timetable = subject.remarks = nil
69
- subject.to_xml.must_equal <<~END
70
- <!-- NavigationalAid: [TACAN] TTT -->
71
- <Tcn source="LF|GEN|0.0 FACTORY|0|0">
72
- <TcnUid>
73
- <codeId>TTT</codeId>
74
- <geoLat>47.85916667N</geoLat>
75
- <geoLong>007.56000000E</geoLong>
76
- </TcnUid>
77
- <OrgUid>
78
- <txtName>FRANCE</txtName>
79
- </OrgUid>
80
- <codeChannel>29X</codeChannel>
81
- <valGhostFreq>109.2</valGhostFreq>
82
- <uomGhostFreq>MHZ</uomGhostFreq>
83
- <codeDatum>WGE</codeDatum>
84
- </Tcn>
85
- END
86
- end
87
- end
88
- end
@@ -1,245 +0,0 @@
1
- require_relative '../../../../spec_helper'
2
-
3
- describe AIXM::Feature::NavigationalAid::VOR do
4
- context "VOR" do
5
- subject do
6
- AIXM::Factory.vor
7
- end
8
-
9
- describe :type= do
10
- it "fails on invalid values" do
11
- [nil, :foobar, 123].wont_be_written_to subject, :type
12
- end
13
-
14
- it "looks up valid values" do
15
- subject.tap { |s| s.type = :conventional }.type.must_equal :conventional
16
- subject.tap { |s| s.type = :DVOR }.type.must_equal :doppler
17
- end
18
- end
19
-
20
- describe :f= do
21
- it "fails on invalid values" do
22
- [nil, :foobar, 123].wont_be_written_to subject, :f
23
- end
24
-
25
- it "accepts valid values" do
26
- [AIXM.f(110, :mhz)].must_be_written_to subject, :f
27
- end
28
- end
29
-
30
- describe :north= do
31
- it "fails on invalid values" do
32
- [nil, :foobar, 123].wont_be_written_to subject, :north
33
- end
34
-
35
- it "looks up valid values" do
36
- subject.tap { |s| s.north = :magnetic }.north.must_equal :magnetic
37
- subject.tap { |s| s.north = :TRUE }.north.must_equal :geographic
38
- end
39
- end
40
-
41
- describe :kind do
42
- it "must return class/type combo" do
43
- subject.kind.must_equal "VOR:VOR"
44
- end
45
- end
46
-
47
- describe :to_xml do
48
- it "builds correct complete OFMX" do
49
- AIXM.ofmx!
50
- subject.to_xml.must_equal <<~END
51
- <!-- NavigationalAid: [VOR:VOR] VVV / VOR NAVAID -->
52
- <Vor source="LF|GEN|0.0 FACTORY|0|0">
53
- <VorUid>
54
- <codeId>VVV</codeId>
55
- <geoLat>47.85916667N</geoLat>
56
- <geoLong>007.56000000E</geoLong>
57
- </VorUid>
58
- <OrgUid>
59
- <txtName>FRANCE</txtName>
60
- </OrgUid>
61
- <txtName>VOR NAVAID</txtName>
62
- <codeType>VOR</codeType>
63
- <valFreq>111</valFreq>
64
- <uomFreq>MHZ</uomFreq>
65
- <codeTypeNorth>TRUE</codeTypeNorth>
66
- <codeDatum>WGE</codeDatum>
67
- <valElev>500</valElev>
68
- <uomDistVer>FT</uomDistVer>
69
- <Vtt>
70
- <codeWorkHr>H24</codeWorkHr>
71
- </Vtt>
72
- <txtRmk>vor navaid</txtRmk>
73
- </Vor>
74
- END
75
- end
76
-
77
- it "builds correct minimal OFMX" do
78
- AIXM.ofmx!
79
- subject.name = subject.z = subject.timetable = subject.remarks = nil
80
- subject.to_xml.must_equal <<~END
81
- <!-- NavigationalAid: [VOR:VOR] VVV -->
82
- <Vor source="LF|GEN|0.0 FACTORY|0|0">
83
- <VorUid>
84
- <codeId>VVV</codeId>
85
- <geoLat>47.85916667N</geoLat>
86
- <geoLong>007.56000000E</geoLong>
87
- </VorUid>
88
- <OrgUid>
89
- <txtName>FRANCE</txtName>
90
- </OrgUid>
91
- <codeType>VOR</codeType>
92
- <valFreq>111</valFreq>
93
- <uomFreq>MHZ</uomFreq>
94
- <codeTypeNorth>TRUE</codeTypeNorth>
95
- <codeDatum>WGE</codeDatum>
96
- </Vor>
97
- END
98
- end
99
- end
100
- end
101
-
102
- context "VOR/DME" do
103
- subject do
104
- AIXM::Factory.vor.tap do |vor|
105
- vor.name = "VOR/DME NAVAID"
106
- vor.remarks = "vor/dme navaid"
107
- vor.associate_dme(channel: '84X')
108
- end
109
- end
110
-
111
- describe :kind do
112
- it "must return class/type combo" do
113
- subject.kind.must_equal "VOR:VOR"
114
- end
115
- end
116
-
117
- describe :to_xml do
118
- it "builds correct OFMX" do
119
- AIXM.ofmx!
120
- subject.to_xml.must_equal <<~END
121
- <!-- NavigationalAid: [VOR:VOR] VVV / VOR/DME NAVAID -->
122
- <Vor source="LF|GEN|0.0 FACTORY|0|0">
123
- <VorUid>
124
- <codeId>VVV</codeId>
125
- <geoLat>47.85916667N</geoLat>
126
- <geoLong>007.56000000E</geoLong>
127
- </VorUid>
128
- <OrgUid>
129
- <txtName>FRANCE</txtName>
130
- </OrgUid>
131
- <txtName>VOR/DME NAVAID</txtName>
132
- <codeType>VOR</codeType>
133
- <valFreq>111</valFreq>
134
- <uomFreq>MHZ</uomFreq>
135
- <codeTypeNorth>TRUE</codeTypeNorth>
136
- <codeDatum>WGE</codeDatum>
137
- <valElev>500</valElev>
138
- <uomDistVer>FT</uomDistVer>
139
- <Vtt>
140
- <codeWorkHr>H24</codeWorkHr>
141
- </Vtt>
142
- <txtRmk>vor/dme navaid</txtRmk>
143
- </Vor>
144
- <!-- NavigationalAid: [DME] VVV / VOR/DME NAVAID -->
145
- <Dme>
146
- <DmeUid>
147
- <codeId>VVV</codeId>
148
- <geoLat>47.85916667N</geoLat>
149
- <geoLong>007.56000000E</geoLong>
150
- </DmeUid>
151
- <OrgUid>
152
- <txtName>FRANCE</txtName>
153
- </OrgUid>
154
- <VorUid>
155
- <codeId>VVV</codeId>
156
- <geoLat>47.85916667N</geoLat>
157
- <geoLong>007.56000000E</geoLong>
158
- </VorUid>
159
- <txtName>VOR/DME NAVAID</txtName>
160
- <codeChannel>84X</codeChannel>
161
- <codeDatum>WGE</codeDatum>
162
- <valElev>500</valElev>
163
- <uomDistVer>FT</uomDistVer>
164
- <Dtt>
165
- <codeWorkHr>H24</codeWorkHr>
166
- </Dtt>
167
- <txtRmk>vor/dme navaid</txtRmk>
168
- </Dme>
169
- END
170
- end
171
- end
172
- end
173
-
174
- context "complete VORTAC" do
175
- subject do
176
- AIXM::Factory.vor.tap do |vor|
177
- vor.name = "VORTAC NAVAID"
178
- vor.remarks = "vortac navaid"
179
- vor.associate_tacan(channel: '54X')
180
- end
181
- end
182
-
183
- describe :kind do
184
- it "must return class/type combo" do
185
- subject.kind.must_equal "VOR:VOR"
186
- end
187
- end
188
-
189
- describe :to_xml do
190
- it "builds correct OFMX" do
191
- AIXM.ofmx!
192
- subject.to_xml.must_equal <<~END
193
- <!-- NavigationalAid: [VOR:VOR] VVV / VORTAC NAVAID -->
194
- <Vor source="LF|GEN|0.0 FACTORY|0|0">
195
- <VorUid>
196
- <codeId>VVV</codeId>
197
- <geoLat>47.85916667N</geoLat>
198
- <geoLong>007.56000000E</geoLong>
199
- </VorUid>
200
- <OrgUid>
201
- <txtName>FRANCE</txtName>
202
- </OrgUid>
203
- <txtName>VORTAC NAVAID</txtName>
204
- <codeType>VOR</codeType>
205
- <valFreq>111</valFreq>
206
- <uomFreq>MHZ</uomFreq>
207
- <codeTypeNorth>TRUE</codeTypeNorth>
208
- <codeDatum>WGE</codeDatum>
209
- <valElev>500</valElev>
210
- <uomDistVer>FT</uomDistVer>
211
- <Vtt>
212
- <codeWorkHr>H24</codeWorkHr>
213
- </Vtt>
214
- <txtRmk>vortac navaid</txtRmk>
215
- </Vor>
216
- <!-- NavigationalAid: [TACAN] VVV / VORTAC NAVAID -->
217
- <Tcn>
218
- <TcnUid>
219
- <codeId>VVV</codeId>
220
- <geoLat>47.85916667N</geoLat>
221
- <geoLong>007.56000000E</geoLong>
222
- </TcnUid>
223
- <OrgUid>
224
- <txtName>FRANCE</txtName>
225
- </OrgUid>
226
- <VorUid>
227
- <codeId>VVV</codeId>
228
- <geoLat>47.85916667N</geoLat>
229
- <geoLong>007.56000000E</geoLong>
230
- </VorUid>
231
- <txtName>VORTAC NAVAID</txtName>
232
- <codeChannel>54X</codeChannel>
233
- <codeDatum>WGE</codeDatum>
234
- <valElev>500</valElev>
235
- <uomDistVer>FT</uomDistVer>
236
- <Ttt>
237
- <codeWorkHr>H24</codeWorkHr>
238
- </Ttt>
239
- <txtRmk>vortac navaid</txtRmk>
240
- </Tcn>
241
- END
242
- end
243
- end
244
- end
245
- end
@@ -1,52 +0,0 @@
1
- require_relative '../../../spec_helper'
2
-
3
- describe AIXM::Feature::NavigationalAid do
4
- subject do
5
- AIXM::Feature::NavigationalAid.send(:new,
6
- organisation: AIXM::Factory.organisation,
7
- id: 'XXX',
8
- xy: AIXM::Factory.xy
9
- )
10
- end
11
-
12
- describe :id= do
13
- it "fails on invalid values" do
14
- -> { subject.id = 123 }.must_raise ArgumentError
15
- end
16
-
17
- it "upcases value" do
18
- subject.tap { |s| s.id = 'lol' }.id.must_equal 'LOL'
19
- end
20
- end
21
-
22
- describe :name= do
23
- it "fails on invalid values" do
24
- [:foobar, 123].wont_be_written_to subject, :name
25
- end
26
-
27
- it "accepts nil value" do
28
- [nil].must_be_written_to subject, :name
29
- end
30
-
31
- it "upcases and transcodes value" do
32
- subject.tap { |s| s.name = 'löl' }.name.must_equal 'LOEL'
33
- end
34
- end
35
-
36
- describe :xy= do
37
- macro :xy
38
- end
39
-
40
- describe :z= do
41
- macro :z_qnh
42
-
43
- it "accepts nil value" do
44
- [nil].must_be_written_to subject, :z
45
- end
46
- end
47
-
48
- describe :remarks= do
49
- macro :remarks
50
- end
51
-
52
- end