aixm 0.2.3 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.ruby-version +1 -1
- data/.yardopts +3 -0
- data/CHANGELOG.md +34 -14
- data/Guardfile +1 -0
- data/README.md +64 -257
- data/lib/aixm.rb +16 -7
- data/lib/aixm/component.rb +6 -0
- data/lib/aixm/component/frequency.rb +135 -0
- data/lib/aixm/component/geometry.rb +34 -23
- data/lib/aixm/component/geometry/arc.rb +37 -22
- data/lib/aixm/component/geometry/border.rb +29 -20
- data/lib/aixm/component/geometry/circle.rb +39 -22
- data/lib/aixm/component/geometry/point.rb +29 -13
- data/lib/aixm/component/helipad.rb +154 -0
- data/lib/aixm/component/layer.rb +91 -0
- data/lib/aixm/component/runway.rb +294 -0
- data/lib/aixm/component/service.rb +170 -0
- data/lib/aixm/component/timetable.rb +65 -0
- data/lib/aixm/component/vertical_limits.rb +65 -29
- data/lib/aixm/config.rb +87 -0
- data/lib/aixm/document.rb +66 -42
- data/lib/aixm/errors.rb +11 -0
- data/lib/aixm/f.rb +34 -20
- data/lib/aixm/feature.rb +38 -0
- data/lib/aixm/feature/airport.rb +473 -0
- data/lib/aixm/feature/airspace.rb +145 -92
- data/lib/aixm/feature/navigational_aid.rb +94 -0
- data/lib/aixm/feature/navigational_aid/designated_point.rb +50 -54
- data/lib/aixm/feature/navigational_aid/dme.rb +48 -40
- data/lib/aixm/feature/navigational_aid/marker.rb +55 -45
- data/lib/aixm/feature/navigational_aid/ndb.rb +54 -50
- data/lib/aixm/feature/navigational_aid/tacan.rb +38 -31
- data/lib/aixm/feature/navigational_aid/vor.rb +84 -76
- data/lib/aixm/feature/organisation.rb +97 -0
- data/lib/aixm/feature/unit.rb +152 -0
- data/lib/aixm/refinements.rb +132 -47
- data/lib/aixm/shortcuts.rb +11 -6
- data/lib/aixm/version.rb +1 -1
- data/lib/aixm/xy.rb +64 -20
- data/lib/aixm/z.rb +51 -22
- data/{lib/aixm/schemas → schemas/aixm}/4.5/AIXM-DataTypes.xsd +0 -0
- data/{lib/aixm/schemas → schemas/aixm}/4.5/AIXM-Features.xsd +0 -0
- data/{lib/aixm/schemas → schemas/aixm}/4.5/AIXM-Snapshot.xsd +0 -0
- data/schemas/ofmx/0/OFMX-DataTypes.xsd +5077 -0
- data/schemas/ofmx/0/OFMX-Features.xsd +9955 -0
- data/schemas/ofmx/0/OFMX-Snapshot.xsd +217 -0
- data/spec/factory.rb +209 -33
- data/spec/lib/aixm/component/frequency_spec.rb +75 -0
- data/spec/lib/aixm/component/geometry/arc_spec.rb +28 -22
- data/spec/lib/aixm/component/geometry/border_spec.rb +23 -20
- data/spec/lib/aixm/component/geometry/circle_spec.rb +31 -22
- data/spec/lib/aixm/component/geometry/point_spec.rb +11 -14
- data/spec/lib/aixm/component/geometry_spec.rb +150 -69
- data/spec/lib/aixm/component/helipad_spec.rb +136 -0
- data/spec/lib/aixm/component/layer_spec.rb +110 -0
- data/spec/lib/aixm/component/runway_spec.rb +402 -0
- data/spec/lib/aixm/component/service_spec.rb +61 -0
- data/spec/lib/aixm/component/timetable_spec.rb +49 -0
- data/spec/lib/aixm/component/vertical_limits_spec.rb +39 -20
- data/spec/lib/aixm/config_spec.rb +41 -0
- data/spec/lib/aixm/document_spec.rb +637 -147
- data/spec/lib/aixm/errors_spec.rb +14 -0
- data/spec/lib/aixm/f_spec.rb +17 -10
- data/spec/lib/aixm/feature/airport_spec.rb +546 -0
- data/spec/lib/aixm/feature/airspace_spec.rb +349 -226
- data/spec/lib/aixm/feature/navigational_aid/designated_point_spec.rb +47 -36
- data/spec/lib/aixm/feature/navigational_aid/dme_spec.rb +61 -36
- data/spec/lib/aixm/feature/navigational_aid/marker_spec.rb +61 -113
- data/spec/lib/aixm/feature/navigational_aid/ndb_spec.rb +65 -79
- data/spec/lib/aixm/feature/navigational_aid/tacan_spec.rb +57 -36
- data/spec/lib/aixm/feature/navigational_aid/vor_spec.rb +86 -112
- data/spec/lib/aixm/feature/navigational_aid_spec.rb +52 -0
- data/spec/lib/aixm/feature/organisation_spec.rb +77 -0
- data/spec/lib/aixm/feature/unit_spec.rb +227 -0
- data/spec/lib/aixm/feature_spec.rb +58 -0
- data/spec/lib/aixm/refinements_spec.rb +187 -178
- data/spec/lib/aixm/xy_spec.rb +45 -34
- data/spec/lib/aixm/z_spec.rb +19 -21
- data/spec/macros/organisation.rb +11 -0
- data/spec/macros/remarks.rb +12 -0
- data/spec/macros/timetable.rb +11 -0
- data/spec/macros/xy.rb +11 -0
- data/spec/macros/z_qnh.rb +11 -0
- data/spec/spec_helper.rb +26 -0
- metadata +60 -19
- data/lib/aixm/base.rb +0 -10
- data/lib/aixm/component/base.rb +0 -6
- data/lib/aixm/component/class_layer.rb +0 -46
- data/lib/aixm/component/geometry/base.rb +0 -8
- data/lib/aixm/component/schedule.rb +0 -43
- data/lib/aixm/feature/base.rb +0 -6
- data/lib/aixm/feature/navigational_aid/base.rb +0 -79
- data/spec/lib/aixm/component/class_layer_spec.rb +0 -74
- data/spec/lib/aixm/component/schedule_spec.rb +0 -33
- data/spec/lib/aixm/feature/navigational_aid/base_spec.rb +0 -41
@@ -1,50 +1,71 @@
|
|
1
1
|
require_relative '../../../../spec_helper'
|
2
2
|
|
3
3
|
describe AIXM::Feature::NavigationalAid::TACAN do
|
4
|
-
|
5
|
-
|
6
|
-
|
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].wont_be_written_to subject, :channel
|
7
11
|
end
|
8
12
|
|
9
|
-
|
10
|
-
subject.
|
13
|
+
it "upcases value" do
|
14
|
+
subject.tap { |s| s.channel = '3x' }.channel.must_equal '3X'
|
11
15
|
end
|
16
|
+
end
|
12
17
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
end
|
18
|
+
describe :kind do
|
19
|
+
it "must return class/type combo" do
|
20
|
+
subject.kind.must_equal "TACAN"
|
17
21
|
end
|
22
|
+
end
|
18
23
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
24
|
+
describe :to_xml do
|
25
|
+
it "builds correct complete OFMX" do
|
26
|
+
AIXM.ofmx!
|
27
|
+
subject.to_xml.must_equal <<~END
|
28
|
+
<!-- NavigationalAid: [TACAN] TACAN NAVAID -->
|
29
|
+
<Tcn source="LF|GEN|0.0 FACTORY|0|0">
|
30
|
+
<TcnUid region="LF">
|
31
|
+
<codeId>TTT</codeId>
|
32
|
+
<geoLat>47.85916667N</geoLat>
|
33
|
+
<geoLong>007.56000000E</geoLong>
|
34
|
+
</TcnUid>
|
35
|
+
<OrgUid region="LF">
|
36
|
+
<txtName>FRANCE</txtName>
|
37
|
+
</OrgUid>
|
38
|
+
<txtName>TACAN NAVAID</txtName>
|
39
|
+
<codeChannel>29X</codeChannel>
|
40
|
+
<codeDatum>WGE</codeDatum>
|
41
|
+
<valElev>500</valElev>
|
42
|
+
<uomDistVer>FT</uomDistVer>
|
43
|
+
<Ttt>
|
44
|
+
<codeWorkHr>H24</codeWorkHr>
|
45
|
+
</Ttt>
|
46
|
+
<txtRmk>tacan navaid</txtRmk>
|
47
|
+
</Tcn>
|
48
|
+
END
|
23
49
|
end
|
24
50
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
</
|
35
|
-
|
36
|
-
|
37
|
-
<
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
</Ttt>
|
44
|
-
<txtRmk>tacan navaid</txtRmk>
|
45
|
-
</Tcn>
|
46
|
-
END
|
47
|
-
end
|
51
|
+
it "builds correct minimal OFMX" do
|
52
|
+
AIXM.ofmx!
|
53
|
+
subject.name = subject.z = subject.timetable = subject.remarks = nil
|
54
|
+
subject.to_xml.must_equal <<~END
|
55
|
+
<!-- NavigationalAid: [TACAN] UNNAMED -->
|
56
|
+
<Tcn source="LF|GEN|0.0 FACTORY|0|0">
|
57
|
+
<TcnUid region="LF">
|
58
|
+
<codeId>TTT</codeId>
|
59
|
+
<geoLat>47.85916667N</geoLat>
|
60
|
+
<geoLong>007.56000000E</geoLong>
|
61
|
+
</TcnUid>
|
62
|
+
<OrgUid region="LF">
|
63
|
+
<txtName>FRANCE</txtName>
|
64
|
+
</OrgUid>
|
65
|
+
<codeChannel>29X</codeChannel>
|
66
|
+
<codeDatum>WGE</codeDatum>
|
67
|
+
</Tcn>
|
68
|
+
END
|
48
69
|
end
|
49
70
|
end
|
50
71
|
end
|
@@ -1,25 +1,41 @@
|
|
1
1
|
require_relative '../../../../spec_helper'
|
2
2
|
|
3
3
|
describe AIXM::Feature::NavigationalAid::VOR do
|
4
|
-
|
5
|
-
|
6
|
-
AIXM.
|
4
|
+
context "VOR" do
|
5
|
+
subject do
|
6
|
+
AIXM::Factory.vor
|
7
7
|
end
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
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
|
13
18
|
end
|
14
|
-
end
|
15
19
|
|
16
|
-
|
17
|
-
|
18
|
-
|
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
|
19
28
|
end
|
20
29
|
|
21
|
-
|
22
|
-
|
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
|
23
39
|
end
|
24
40
|
|
25
41
|
describe :kind do
|
@@ -28,23 +44,20 @@ describe AIXM::Feature::NavigationalAid::VOR do
|
|
28
44
|
end
|
29
45
|
end
|
30
46
|
|
31
|
-
describe :
|
32
|
-
it "
|
33
|
-
|
34
|
-
|
35
|
-
end
|
36
|
-
|
37
|
-
describe :to_aixm do
|
38
|
-
it "must build correct XML of VOR with OFM extension" do
|
39
|
-
subject.to_aixm(:ofm).must_equal <<~END
|
47
|
+
describe :to_xml do
|
48
|
+
it "builds correct complete OFMX" do
|
49
|
+
AIXM.ofmx!
|
50
|
+
subject.to_xml.must_equal <<~END
|
40
51
|
<!-- NavigationalAid: [VOR:VOR] VOR NAVAID -->
|
41
|
-
<Vor>
|
42
|
-
<VorUid
|
52
|
+
<Vor source="LF|GEN|0.0 FACTORY|0|0">
|
53
|
+
<VorUid region="LF">
|
43
54
|
<codeId>VVV</codeId>
|
44
55
|
<geoLat>47.85916667N</geoLat>
|
45
|
-
<geoLong>
|
56
|
+
<geoLong>007.56000000E</geoLong>
|
46
57
|
</VorUid>
|
47
|
-
<OrgUid
|
58
|
+
<OrgUid region="LF">
|
59
|
+
<txtName>FRANCE</txtName>
|
60
|
+
</OrgUid>
|
48
61
|
<txtName>VOR NAVAID</txtName>
|
49
62
|
<codeType>VOR</codeType>
|
50
63
|
<valFreq>111</valFreq>
|
@@ -60,62 +73,33 @@ describe AIXM::Feature::NavigationalAid::VOR do
|
|
60
73
|
</Vor>
|
61
74
|
END
|
62
75
|
end
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
context "complete Doppler VOR" do
|
67
|
-
subject do
|
68
|
-
AIXM::Factory.vor.tap do |vor|
|
69
|
-
vor.type = :doppler
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
73
|
-
let :digest do
|
74
|
-
subject.to_digest
|
75
|
-
end
|
76
|
-
|
77
|
-
describe :kind do
|
78
|
-
it "must return class/type combo" do
|
79
|
-
subject.kind.must_equal "VOR:DVOR"
|
80
|
-
end
|
81
|
-
end
|
82
76
|
|
83
|
-
|
84
|
-
|
85
|
-
subject.
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
it "must build correct XML of VOR with OFM extension" do
|
91
|
-
subject.to_aixm(:ofm).must_equal <<~END
|
92
|
-
<!-- NavigationalAid: [VOR:DVOR] VOR NAVAID -->
|
93
|
-
<Vor>
|
94
|
-
<VorUid mid="#{digest}" newEntity="true">
|
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] UNNAMED -->
|
82
|
+
<Vor source="LF|GEN|0.0 FACTORY|0|0">
|
83
|
+
<VorUid region="LF">
|
95
84
|
<codeId>VVV</codeId>
|
96
85
|
<geoLat>47.85916667N</geoLat>
|
97
|
-
<geoLong>
|
86
|
+
<geoLong>007.56000000E</geoLong>
|
98
87
|
</VorUid>
|
99
|
-
<OrgUid
|
100
|
-
|
101
|
-
|
88
|
+
<OrgUid region="LF">
|
89
|
+
<txtName>FRANCE</txtName>
|
90
|
+
</OrgUid>
|
91
|
+
<codeType>VOR</codeType>
|
102
92
|
<valFreq>111</valFreq>
|
103
93
|
<uomFreq>MHZ</uomFreq>
|
104
94
|
<codeTypeNorth>TRUE</codeTypeNorth>
|
105
95
|
<codeDatum>WGE</codeDatum>
|
106
|
-
<valElev>500</valElev>
|
107
|
-
<uomDistVer>FT</uomDistVer>
|
108
|
-
<Vtt>
|
109
|
-
<codeWorkHr>H24</codeWorkHr>
|
110
|
-
</Vtt>
|
111
|
-
<txtRmk>vor navaid</txtRmk>
|
112
96
|
</Vor>
|
113
97
|
END
|
114
98
|
end
|
115
99
|
end
|
116
100
|
end
|
117
101
|
|
118
|
-
context "
|
102
|
+
context "VOR/DME" do
|
119
103
|
subject do
|
120
104
|
AIXM::Factory.vor.tap do |vor|
|
121
105
|
vor.name = "VOR/DME NAVAID"
|
@@ -124,33 +108,26 @@ describe AIXM::Feature::NavigationalAid::VOR do
|
|
124
108
|
end
|
125
109
|
end
|
126
110
|
|
127
|
-
let :digests do
|
128
|
-
[subject.to_digest, subject.dme.to_digest]
|
129
|
-
end
|
130
|
-
|
131
111
|
describe :kind do
|
132
112
|
it "must return class/type combo" do
|
133
113
|
subject.kind.must_equal "VOR:VOR"
|
134
114
|
end
|
135
115
|
end
|
136
116
|
|
137
|
-
describe :
|
138
|
-
it "
|
139
|
-
|
140
|
-
|
141
|
-
end
|
142
|
-
|
143
|
-
describe :to_aixm do
|
144
|
-
it "must build correct XML of VOR with OFM extension" do
|
145
|
-
subject.to_aixm(:ofm).must_equal <<~END
|
117
|
+
describe :to_xml do
|
118
|
+
it "builds correct OFMX" do
|
119
|
+
AIXM.ofmx!
|
120
|
+
subject.to_xml.must_equal <<~END
|
146
121
|
<!-- NavigationalAid: [VOR:VOR] VOR/DME NAVAID -->
|
147
|
-
<Vor>
|
148
|
-
<VorUid
|
122
|
+
<Vor source="LF|GEN|0.0 FACTORY|0|0">
|
123
|
+
<VorUid region="LF">
|
149
124
|
<codeId>VVV</codeId>
|
150
125
|
<geoLat>47.85916667N</geoLat>
|
151
|
-
<geoLong>
|
126
|
+
<geoLong>007.56000000E</geoLong>
|
152
127
|
</VorUid>
|
153
|
-
<OrgUid
|
128
|
+
<OrgUid region="LF">
|
129
|
+
<txtName>FRANCE</txtName>
|
130
|
+
</OrgUid>
|
154
131
|
<txtName>VOR/DME NAVAID</txtName>
|
155
132
|
<codeType>VOR</codeType>
|
156
133
|
<valFreq>111</valFreq>
|
@@ -166,16 +143,18 @@ describe AIXM::Feature::NavigationalAid::VOR do
|
|
166
143
|
</Vor>
|
167
144
|
<!-- NavigationalAid: [DME] VOR/DME NAVAID -->
|
168
145
|
<Dme>
|
169
|
-
<DmeUid
|
146
|
+
<DmeUid region="LF">
|
170
147
|
<codeId>VVV</codeId>
|
171
148
|
<geoLat>47.85916667N</geoLat>
|
172
|
-
<geoLong>
|
149
|
+
<geoLong>007.56000000E</geoLong>
|
173
150
|
</DmeUid>
|
174
|
-
<OrgUid
|
175
|
-
|
151
|
+
<OrgUid region="LF">
|
152
|
+
<txtName>FRANCE</txtName>
|
153
|
+
</OrgUid>
|
154
|
+
<VorUid region="LF">
|
176
155
|
<codeId>VVV</codeId>
|
177
156
|
<geoLat>47.85916667N</geoLat>
|
178
|
-
<geoLong>
|
157
|
+
<geoLong>007.56000000E</geoLong>
|
179
158
|
</VorUid>
|
180
159
|
<txtName>VOR/DME NAVAID</txtName>
|
181
160
|
<codeChannel>84X</codeChannel>
|
@@ -201,33 +180,26 @@ describe AIXM::Feature::NavigationalAid::VOR do
|
|
201
180
|
end
|
202
181
|
end
|
203
182
|
|
204
|
-
let :digests do
|
205
|
-
[subject.to_digest, subject.tacan.to_digest]
|
206
|
-
end
|
207
|
-
|
208
183
|
describe :kind do
|
209
184
|
it "must return class/type combo" do
|
210
185
|
subject.kind.must_equal "VOR:VOR"
|
211
186
|
end
|
212
187
|
end
|
213
188
|
|
214
|
-
describe :
|
215
|
-
it "
|
216
|
-
|
217
|
-
|
218
|
-
end
|
219
|
-
|
220
|
-
describe :to_aixm do
|
221
|
-
it "must build correct XML of VOR with OFM extension" do
|
222
|
-
subject.to_aixm(:ofm).must_equal <<~END
|
189
|
+
describe :to_xml do
|
190
|
+
it "builds correct OFMX" do
|
191
|
+
AIXM.ofmx!
|
192
|
+
subject.to_xml.must_equal <<~END
|
223
193
|
<!-- NavigationalAid: [VOR:VOR] VORTAC NAVAID -->
|
224
|
-
<Vor>
|
225
|
-
<VorUid
|
194
|
+
<Vor source="LF|GEN|0.0 FACTORY|0|0">
|
195
|
+
<VorUid region="LF">
|
226
196
|
<codeId>VVV</codeId>
|
227
197
|
<geoLat>47.85916667N</geoLat>
|
228
|
-
<geoLong>
|
198
|
+
<geoLong>007.56000000E</geoLong>
|
229
199
|
</VorUid>
|
230
|
-
<OrgUid
|
200
|
+
<OrgUid region="LF">
|
201
|
+
<txtName>FRANCE</txtName>
|
202
|
+
</OrgUid>
|
231
203
|
<txtName>VORTAC NAVAID</txtName>
|
232
204
|
<codeType>VOR</codeType>
|
233
205
|
<valFreq>111</valFreq>
|
@@ -243,16 +215,18 @@ describe AIXM::Feature::NavigationalAid::VOR do
|
|
243
215
|
</Vor>
|
244
216
|
<!-- NavigationalAid: [TACAN] VORTAC NAVAID -->
|
245
217
|
<Tcn>
|
246
|
-
<TcnUid
|
218
|
+
<TcnUid region="LF">
|
247
219
|
<codeId>VVV</codeId>
|
248
220
|
<geoLat>47.85916667N</geoLat>
|
249
|
-
<geoLong>
|
221
|
+
<geoLong>007.56000000E</geoLong>
|
250
222
|
</TcnUid>
|
251
|
-
<OrgUid
|
252
|
-
|
223
|
+
<OrgUid region="LF">
|
224
|
+
<txtName>FRANCE</txtName>
|
225
|
+
</OrgUid>
|
226
|
+
<VorUid region="LF">
|
253
227
|
<codeId>VVV</codeId>
|
254
228
|
<geoLat>47.85916667N</geoLat>
|
255
|
-
<geoLong>
|
229
|
+
<geoLong>007.56000000E</geoLong>
|
256
230
|
</VorUid>
|
257
231
|
<txtName>VORTAC NAVAID</txtName>
|
258
232
|
<codeChannel>54X</codeChannel>
|
@@ -0,0 +1,52 @@
|
|
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
|