rcap 2.7.3 → 2.7.4
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/.ruby-version +1 -1
- data/CHANGELOG.md +4 -0
- data/lib/rcap/base/alert.rb +13 -19
- data/lib/rcap/base/info.rb +16 -16
- data/lib/rcap/base/parameter.rb +2 -2
- data/lib/rcap/base/resource.rb +4 -4
- data/lib/rcap/cap_1_0/alert.rb +14 -20
- data/lib/rcap/cap_1_1/info.rb +14 -14
- data/lib/rcap/cap_1_1/resource.rb +6 -6
- data/lib/rcap/cap_1_2/info.rb +13 -13
- data/lib/rcap/cap_1_2/resource.rb +6 -6
- data/lib/rcap/custom_validators.rb +18 -16
- data/lib/rcap/utilities.rb +1 -1
- data/lib/rcap/validation.rb +8 -5
- data/lib/rcap/version.rb +1 -1
- data/spec/alert_spec.rb +8 -9
- data/spec/cap_1_0/alert_spec.rb +4 -5
- data/spec/cap_1_0/area_spec.rb +7 -10
- data/spec/cap_1_0/event_code_spec.rb +1 -1
- data/spec/cap_1_0/geocode_spec.rb +1 -1
- data/spec/cap_1_0/info_spec.rb +38 -38
- data/spec/cap_1_0/resource_spec.rb +6 -7
- data/spec/cap_1_1/alert_spec.rb +6 -7
- data/spec/cap_1_1/area_spec.rb +6 -8
- data/spec/cap_1_1/info_spec.rb +26 -26
- data/spec/cap_1_1/parameter_spec.rb +1 -2
- data/spec/cap_1_1/resource_spec.rb +12 -12
- data/spec/cap_1_2/alert_spec.rb +7 -8
- data/spec/cap_1_2/area_spec.rb +6 -6
- data/spec/cap_1_2/info_spec.rb +25 -26
- data/spec/cap_1_2/resource_spec.rb +12 -12
- data/spec/extensions_spec.rb +2 -2
- data/spec/spec_helper.rb +2 -2
- data/spec/validations_spec.rb +0 -1
- metadata +6 -7
data/spec/cap_1_1/area_spec.rb
CHANGED
@@ -23,7 +23,6 @@ describe(RCAP::CAP_1_1::Area) do
|
|
23
23
|
point.longitude = 2
|
24
24
|
end
|
25
25
|
end
|
26
|
-
|
27
26
|
end
|
28
27
|
|
29
28
|
context('on initialisation') do
|
@@ -71,7 +70,6 @@ describe(RCAP::CAP_1_1::Area) do
|
|
71
70
|
|
72
71
|
context('from XML') do
|
73
72
|
before(:each) do
|
74
|
-
|
75
73
|
@alert = RCAP::CAP_1_1::Alert.new
|
76
74
|
@alert.add_info.add_area(&@area_builder)
|
77
75
|
@xml_string = @alert.to_xml
|
@@ -112,27 +110,27 @@ describe(RCAP::CAP_1_1::Area) do
|
|
112
110
|
end
|
113
111
|
|
114
112
|
it('should export the area description correctly') do
|
115
|
-
@area_hash[
|
113
|
+
@area_hash[RCAP::CAP_1_1::Area::AREA_DESC_KEY].should == @area.area_desc
|
116
114
|
end
|
117
115
|
|
118
116
|
it('should export the altitude correctly') do
|
119
|
-
@area_hash[
|
117
|
+
@area_hash[RCAP::CAP_1_1::Area::ALTITUDE_KEY].should == @area.altitude
|
120
118
|
end
|
121
119
|
|
122
120
|
it('should set the ceiling correctly') do
|
123
|
-
@area_hash[
|
121
|
+
@area_hash[RCAP::CAP_1_1::Area::CEILING_KEY].should == @area.ceiling
|
124
122
|
end
|
125
123
|
|
126
124
|
it('should export the circles correctly') do
|
127
|
-
@area_hash[
|
125
|
+
@area_hash[RCAP::CAP_1_1::Area::CIRCLES_KEY].should == @area.circles.map { |circle| circle.to_a }
|
128
126
|
end
|
129
127
|
|
130
128
|
it('should export the geocodes correctly') do
|
131
|
-
@area_hash[
|
129
|
+
@area_hash[RCAP::CAP_1_1::Area::GEOCODES_KEY].should == @area.geocodes.map { |geocode| geocode.to_h }
|
132
130
|
end
|
133
131
|
|
134
132
|
it('should export the polygons correctly') do
|
135
|
-
@area_hash[
|
133
|
+
@area_hash[RCAP::CAP_1_1::Area::POLYGONS_KEY].should == @area.polygons.map { |polygon| polygon.to_h }
|
136
134
|
end
|
137
135
|
end
|
138
136
|
end
|
data/spec/cap_1_1/info_spec.rb
CHANGED
@@ -34,19 +34,19 @@ describe(RCAP::CAP_1_1::Info) do
|
|
34
34
|
|
35
35
|
[{ name: 'name1', value: 'value1' }, { name: 'name2', value: 'value2' }].each do |event_code_hash|
|
36
36
|
info.add_event_code do |event_code|
|
37
|
-
event_code.name = event_code_hash[
|
38
|
-
event_code.value = event_code_hash[
|
37
|
+
event_code.name = event_code_hash[:name]
|
38
|
+
event_code.value = event_code_hash[:value]
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
42
|
[{ name: 'name1', value: 'value1' }, { name: 'name2', value: 'value2' }].each do |parameter_hash|
|
43
43
|
info.add_parameter do |parameter|
|
44
|
-
parameter.name = parameter_hash[
|
45
|
-
parameter.value = parameter_hash[
|
44
|
+
parameter.name = parameter_hash[:name]
|
45
|
+
parameter.value = parameter_hash[:value]
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
49
|
-
%w
|
49
|
+
%w[Area1 Area2].each do |area_desc|
|
50
50
|
info.add_area do |area|
|
51
51
|
area.area_desc = area_desc
|
52
52
|
end
|
@@ -315,87 +315,87 @@ describe(RCAP::CAP_1_1::Info) do
|
|
315
315
|
end
|
316
316
|
|
317
317
|
it('should export the language correctly') do
|
318
|
-
@info_hash[
|
318
|
+
@info_hash[RCAP::CAP_1_1::Info::LANGUAGE_KEY].should == @info.language
|
319
319
|
end
|
320
320
|
|
321
321
|
it('should export the categories') do
|
322
|
-
@info_hash[
|
322
|
+
@info_hash[RCAP::CAP_1_1::Info::CATEGORIES_KEY].should == @info.categories
|
323
323
|
end
|
324
324
|
|
325
325
|
it('should export the event') do
|
326
|
-
@info_hash[
|
326
|
+
@info_hash[RCAP::CAP_1_1::Info::EVENT_KEY].should == @info.event
|
327
327
|
end
|
328
328
|
|
329
329
|
it('should export the response types') do
|
330
|
-
@info_hash[
|
330
|
+
@info_hash[RCAP::CAP_1_1::Info::RESPONSE_TYPES_KEY].should == @info.response_types
|
331
331
|
end
|
332
332
|
|
333
333
|
it('should export the urgency') do
|
334
|
-
@info_hash[
|
334
|
+
@info_hash[RCAP::CAP_1_1::Info:: URGENCY_KEY].should == @info.urgency
|
335
335
|
end
|
336
336
|
|
337
337
|
it('should export the severity') do
|
338
|
-
@info_hash[
|
338
|
+
@info_hash[RCAP::CAP_1_1::Info:: SEVERITY_KEY].should == @info.severity
|
339
339
|
end
|
340
340
|
|
341
341
|
it('should export the certainty') do
|
342
|
-
@info_hash[
|
342
|
+
@info_hash[RCAP::CAP_1_1::Info:: CERTAINTY_KEY].should == @info.certainty
|
343
343
|
end
|
344
344
|
|
345
345
|
it('should export the audience') do
|
346
|
-
@info_hash[
|
346
|
+
@info_hash[RCAP::CAP_1_1::Info:: AUDIENCE_KEY].should == @info.audience
|
347
347
|
end
|
348
348
|
|
349
349
|
it('should export the effective date') do
|
350
|
-
@info_hash[
|
350
|
+
@info_hash[RCAP::CAP_1_1::Info::EFFECTIVE_KEY].should == @info.effective.to_s_for_cap
|
351
351
|
end
|
352
352
|
|
353
353
|
it('should export the onset date') do
|
354
|
-
@info_hash[
|
354
|
+
@info_hash[RCAP::CAP_1_1::Info::ONSET_KEY].should == @info.onset.to_s_for_cap
|
355
355
|
end
|
356
356
|
|
357
357
|
it('should export the expires date') do
|
358
|
-
@info_hash[
|
358
|
+
@info_hash[RCAP::CAP_1_1::Info::EXPIRES_KEY].should == @info.expires.to_s_for_cap
|
359
359
|
end
|
360
360
|
|
361
361
|
it('should export the sender name') do
|
362
|
-
@info_hash[
|
362
|
+
@info_hash[RCAP::CAP_1_1::Info::SENDER_NAME_KEY].should == @info.sender_name
|
363
363
|
end
|
364
364
|
|
365
365
|
it('should export the headline') do
|
366
|
-
@info_hash[
|
366
|
+
@info_hash[RCAP::CAP_1_1::Info::HEADLINE_KEY].should == @info.headline
|
367
367
|
end
|
368
368
|
|
369
369
|
it('should export the description') do
|
370
|
-
@info_hash[
|
370
|
+
@info_hash[RCAP::CAP_1_1::Info::DESCRIPTION_KEY].should == @info.description
|
371
371
|
end
|
372
372
|
|
373
373
|
it('should export the instruction') do
|
374
|
-
@info_hash[
|
374
|
+
@info_hash[RCAP::CAP_1_1::Info::INSTRUCTION_KEY].should == @info.instruction
|
375
375
|
end
|
376
376
|
|
377
377
|
it('should export the web address ') do
|
378
|
-
@info_hash[
|
378
|
+
@info_hash[RCAP::CAP_1_1::Info::WEB_KEY].should == @info.web
|
379
379
|
end
|
380
380
|
|
381
381
|
it('should export the contact') do
|
382
|
-
@info_hash[
|
382
|
+
@info_hash[RCAP::CAP_1_1::Info::CONTACT_KEY].should == @info.contact
|
383
383
|
end
|
384
384
|
|
385
385
|
it('should export the event codes') do
|
386
|
-
@info_hash[
|
386
|
+
@info_hash[RCAP::CAP_1_1::Info::EVENT_CODES_KEY].should == @info.event_codes.map { |event_code| event_code.to_h }
|
387
387
|
end
|
388
388
|
|
389
389
|
it('should export the parameters ') do
|
390
|
-
@info_hash[
|
390
|
+
@info_hash[RCAP::CAP_1_1::Info::PARAMETERS_KEY].should == @info.parameters.map { |parameter| parameter.to_h }
|
391
391
|
end
|
392
392
|
|
393
393
|
it('should export the resources ') do
|
394
|
-
@info_hash[
|
394
|
+
@info_hash[RCAP::CAP_1_1::Info::RESOURCES_KEY].should == @info.resources.map { |resource| resource.to_h }
|
395
395
|
end
|
396
396
|
|
397
397
|
it('should export the areas') do
|
398
|
-
@info_hash[
|
398
|
+
@info_hash[RCAP::CAP_1_1::Info::AREAS_KEY].should == @info.areas.map { |area| area.to_h }
|
399
399
|
end
|
400
400
|
end
|
401
401
|
end
|
@@ -4,14 +4,13 @@ describe(RCAP::CAP_1_1::Parameter) do
|
|
4
4
|
context('when initialised') do
|
5
5
|
context('from XML') do
|
6
6
|
before(:each) do
|
7
|
-
|
8
7
|
@alert = RCAP::CAP_1_1::Alert.new do |alert|
|
9
8
|
alert.add_info.add_parameter do |parameter|
|
10
9
|
parameter.name = 'name'
|
11
10
|
parameter.value = 'value'
|
12
11
|
end
|
13
12
|
end
|
14
|
-
@original_parameter
|
13
|
+
@original_parameter = @alert.infos.first.parameters.first
|
15
14
|
@xml_string = @alert.to_xml
|
16
15
|
@xml_document = REXML::Document.new(@xml_string)
|
17
16
|
@info_xml_element = RCAP.xpath_first(@xml_document.root, RCAP::CAP_1_1::Info::XPATH, RCAP::CAP_1_1::Alert::XMLNS)
|
@@ -153,33 +153,33 @@ describe(RCAP::CAP_1_1::Resource) do
|
|
153
153
|
end
|
154
154
|
|
155
155
|
it('should set the resource description') do
|
156
|
-
@resource_hash[
|
156
|
+
@resource_hash[RCAP::CAP_1_1::Resource::RESOURCE_DESC_KEY].should == @resource.resource_desc
|
157
157
|
end
|
158
158
|
|
159
159
|
it('should set the mime type') do
|
160
|
-
@resource_hash[
|
160
|
+
@resource_hash[RCAP::CAP_1_1::Resource::MIME_TYPE_KEY].should == @resource.mime_type
|
161
161
|
end
|
162
162
|
|
163
163
|
it('should set the size') do
|
164
|
-
@resource_hash[
|
164
|
+
@resource_hash[RCAP::CAP_1_1::Resource::SIZE_KEY].should == @resource.size
|
165
165
|
end
|
166
166
|
|
167
167
|
it('should set the URI') do
|
168
|
-
@resource_hash[
|
168
|
+
@resource_hash[RCAP::CAP_1_1::Resource::URI_KEY].should == @resource.uri
|
169
169
|
end
|
170
170
|
|
171
171
|
it('should set the dereferenced URI') do
|
172
|
-
@resource_hash[
|
172
|
+
@resource_hash[RCAP::CAP_1_1::Resource::DEREF_URI_KEY].should == @resource.deref_uri
|
173
173
|
end
|
174
174
|
|
175
175
|
it('should set the digest') do
|
176
|
-
@resource_hash[
|
176
|
+
@resource_hash[RCAP::CAP_1_1::Resource::DIGEST_KEY].should == @resource.digest
|
177
177
|
end
|
178
178
|
end
|
179
179
|
|
180
180
|
context('to xml') do
|
181
181
|
it('should be successful') do
|
182
|
-
|
182
|
+
-> { @resource_xml = @resource.to_xml }.should_not(raise_exception)
|
183
183
|
end
|
184
184
|
end
|
185
185
|
end
|
@@ -214,15 +214,15 @@ describe(RCAP::CAP_1_1::Resource) do
|
|
214
214
|
|
215
215
|
describe('#dereference_uri!') do
|
216
216
|
it('should fetch the content and store it in deref_uri as Base64 encoded content') do
|
217
|
-
|
217
|
+
-> { @resource.dereference_uri! }.should(change(@resource, :deref_uri).to(@encoded_content))
|
218
218
|
end
|
219
219
|
|
220
220
|
it('should generate the correct SHA1 hash') do
|
221
|
-
|
221
|
+
-> { @resource.dereference_uri! }.should(change(@resource, :digest).to(Digest::SHA1.hexdigest(@encoded_content)))
|
222
222
|
end
|
223
223
|
|
224
224
|
it('should set the size in bytes') do
|
225
|
-
|
225
|
+
-> { @resource.dereference_uri! }.should(change(@resource, :size).to(@encoded_content.bytesize))
|
226
226
|
end
|
227
227
|
end
|
228
228
|
end
|
@@ -241,11 +241,11 @@ describe(RCAP::CAP_1_1::Resource) do
|
|
241
241
|
|
242
242
|
describe('#calculate_hash_and_size') do
|
243
243
|
it('should generate the correct SHA1 hash') do
|
244
|
-
|
244
|
+
-> { @resource.calculate_hash_and_size }.should(change(@resource, :digest).to(Digest::SHA1.hexdigest(@encoded_content)))
|
245
245
|
end
|
246
246
|
|
247
247
|
it('should set the size in bytes') do
|
248
|
-
|
248
|
+
-> { @resource.calculate_hash_and_size }.should(change(@resource, :size).to(@encoded_content.bytesize))
|
249
249
|
end
|
250
250
|
end
|
251
251
|
|
data/spec/cap_1_2/alert_spec.rb
CHANGED
@@ -12,14 +12,14 @@ describe(RCAP::CAP_1_2::Alert) do
|
|
12
12
|
['Address 1', 'Address 2'].each do |address|
|
13
13
|
alert.addresses << address
|
14
14
|
end
|
15
|
-
%w
|
15
|
+
%w[Code1 Code2].each do |code|
|
16
16
|
alert.codes << code
|
17
17
|
end
|
18
|
-
alert.note
|
19
|
-
%w
|
18
|
+
alert.note = 'Note'
|
19
|
+
%w[Reference1 Reference2].each do |reference|
|
20
20
|
alert.references << reference
|
21
21
|
end
|
22
|
-
%w
|
22
|
+
%w[Incident1 Incident2].each do |incident|
|
23
23
|
alert.incidents << incident
|
24
24
|
end
|
25
25
|
2.times do
|
@@ -29,7 +29,7 @@ describe(RCAP::CAP_1_2::Alert) do
|
|
29
29
|
end
|
30
30
|
|
31
31
|
context('on initialisation') do
|
32
|
-
before(:each)
|
32
|
+
before(:each) do
|
33
33
|
@alert = RCAP::CAP_1_2::Alert.new
|
34
34
|
end
|
35
35
|
|
@@ -77,7 +77,6 @@ describe(RCAP::CAP_1_2::Alert) do
|
|
77
77
|
end
|
78
78
|
|
79
79
|
it_should_behave_like('a successfully parsed CAP 1.2 alert')
|
80
|
-
|
81
80
|
end
|
82
81
|
|
83
82
|
context('from YAML') do
|
@@ -180,7 +179,7 @@ describe(RCAP::CAP_1_2::Alert) do
|
|
180
179
|
|
181
180
|
it('has in invalid info attribute') do
|
182
181
|
@info = RCAP::CAP_1_2::Info.new do |info|
|
183
|
-
info.event
|
182
|
+
info.event = 'Info Event'
|
184
183
|
info.categories << RCAP::CAP_1_2::Info::CATEGORY_GEO
|
185
184
|
info.urgency = RCAP::CAP_1_2::Info::URGENCY_IMMEDIATE
|
186
185
|
info.severity = RCAP::CAP_1_2::Info::SEVERITY_EXTREME
|
@@ -219,7 +218,7 @@ describe(RCAP::CAP_1_2::Alert) do
|
|
219
218
|
describe('#to_xml') do
|
220
219
|
context('with pretty_print = true') do
|
221
220
|
it('should not raise an exception') do
|
222
|
-
|
221
|
+
-> { @alert.to_xml(true) }.should_not(raise_exception)
|
223
222
|
end
|
224
223
|
end
|
225
224
|
end
|
data/spec/cap_1_2/area_spec.rb
CHANGED
@@ -108,27 +108,27 @@ describe(RCAP::CAP_1_2::Area) do
|
|
108
108
|
end
|
109
109
|
|
110
110
|
it('should export the area description correctly') do
|
111
|
-
@area_hash[
|
111
|
+
@area_hash[RCAP::CAP_1_2::Area::AREA_DESC_KEY].should == @area.area_desc
|
112
112
|
end
|
113
113
|
|
114
114
|
it('should export the altitude correctly') do
|
115
|
-
@area_hash[
|
115
|
+
@area_hash[RCAP::CAP_1_2::Area::ALTITUDE_KEY].should == @area.altitude
|
116
116
|
end
|
117
117
|
|
118
118
|
it('should set the ceiling correctly') do
|
119
|
-
@area_hash[
|
119
|
+
@area_hash[RCAP::CAP_1_2::Area::CEILING_KEY].should == @area.ceiling
|
120
120
|
end
|
121
121
|
|
122
122
|
it('should export the circles correctly') do
|
123
|
-
@area_hash[
|
123
|
+
@area_hash[RCAP::CAP_1_2::Area::CIRCLES_KEY].should == @area.circles.map { |circle| circle.to_a }
|
124
124
|
end
|
125
125
|
|
126
126
|
it('should export the geocodes correctly') do
|
127
|
-
@area_hash[
|
127
|
+
@area_hash[RCAP::CAP_1_2::Area::GEOCODES_KEY].should == @area.geocodes.map { |geocode| geocode.to_h }
|
128
128
|
end
|
129
129
|
|
130
130
|
it('should export the polygons correctly') do
|
131
|
-
@area_hash[
|
131
|
+
@area_hash[RCAP::CAP_1_2::Area::POLYGONS_KEY].should == @area.polygons.map { |polygon| polygon.to_h }
|
132
132
|
end
|
133
133
|
end
|
134
134
|
end
|
data/spec/cap_1_2/info_spec.rb
CHANGED
@@ -2,7 +2,6 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe(RCAP::CAP_1_2::Info) do
|
4
4
|
before(:each) do
|
5
|
-
|
6
5
|
@info_builder = lambda do |info|
|
7
6
|
info.categories << RCAP::CAP_1_2::Info::CATEGORY_GEO
|
8
7
|
info.categories << RCAP::CAP_1_2::Info::CATEGORY_FIRE
|
@@ -22,7 +21,7 @@ describe(RCAP::CAP_1_2::Info) do
|
|
22
21
|
info.instruction = 'Instruction'
|
23
22
|
info.web = 'http://website'
|
24
23
|
info.contact = 'contact@address'
|
25
|
-
[%w
|
24
|
+
[%w[name1 value1], %w[name2 value2]].each do |name, value|
|
26
25
|
info.add_event_code do |event_code|
|
27
26
|
event_code.name = name
|
28
27
|
event_code.value = value
|
@@ -34,14 +33,14 @@ describe(RCAP::CAP_1_2::Info) do
|
|
34
33
|
resource.mime_type = 'mime/type'
|
35
34
|
end
|
36
35
|
|
37
|
-
[%w
|
36
|
+
[%w[name1 value1], %w[name2 value2]].each do |name, value|
|
38
37
|
info.add_parameter do |parameter|
|
39
38
|
parameter.name = name
|
40
39
|
parameter.value = value
|
41
40
|
end
|
42
41
|
end
|
43
42
|
|
44
|
-
%w
|
43
|
+
%w[Area1 Area2].each do |area_desc|
|
45
44
|
info.add_area do |area|
|
46
45
|
area.area_desc = area_desc
|
47
46
|
end
|
@@ -273,7 +272,7 @@ describe(RCAP::CAP_1_2::Info) do
|
|
273
272
|
context('is not valid if it') do
|
274
273
|
before(:each) do
|
275
274
|
@info = RCAP::CAP_1_2::Info.new do |info|
|
276
|
-
info.event
|
275
|
+
info.event = 'Info Event'
|
277
276
|
info.categories << RCAP::CAP_1_2::Info::CATEGORY_GEO
|
278
277
|
info.urgency = RCAP::CAP_1_2::Info::URGENCY_IMMEDIATE
|
279
278
|
info.severity = RCAP::CAP_1_2::Info::SEVERITY_EXTREME
|
@@ -318,87 +317,87 @@ describe(RCAP::CAP_1_2::Info) do
|
|
318
317
|
end
|
319
318
|
|
320
319
|
it('should export the language correctly') do
|
321
|
-
@info_hash[
|
320
|
+
@info_hash[RCAP::CAP_1_2::Info::LANGUAGE_KEY].should == @info.language
|
322
321
|
end
|
323
322
|
|
324
323
|
it('should export the categories') do
|
325
|
-
@info_hash[
|
324
|
+
@info_hash[RCAP::CAP_1_2::Info::CATEGORIES_KEY].should == @info.categories
|
326
325
|
end
|
327
326
|
|
328
327
|
it('should export the event') do
|
329
|
-
@info_hash[
|
328
|
+
@info_hash[RCAP::CAP_1_2::Info::EVENT_KEY].should == @info.event
|
330
329
|
end
|
331
330
|
|
332
331
|
it('should export the response types') do
|
333
|
-
@info_hash[
|
332
|
+
@info_hash[RCAP::CAP_1_2::Info::RESPONSE_TYPES_KEY].should == @info.response_types
|
334
333
|
end
|
335
334
|
|
336
335
|
it('should export the urgency') do
|
337
|
-
@info_hash[
|
336
|
+
@info_hash[RCAP::CAP_1_2::Info:: URGENCY_KEY].should == @info.urgency
|
338
337
|
end
|
339
338
|
|
340
339
|
it('should export the severity') do
|
341
|
-
@info_hash[
|
340
|
+
@info_hash[RCAP::CAP_1_2::Info:: SEVERITY_KEY].should == @info.severity
|
342
341
|
end
|
343
342
|
|
344
343
|
it('should export the certainty') do
|
345
|
-
@info_hash[
|
344
|
+
@info_hash[RCAP::CAP_1_2::Info:: CERTAINTY_KEY].should == @info.certainty
|
346
345
|
end
|
347
346
|
|
348
347
|
it('should export the audience') do
|
349
|
-
@info_hash[
|
348
|
+
@info_hash[RCAP::CAP_1_2::Info:: AUDIENCE_KEY].should == @info.audience
|
350
349
|
end
|
351
350
|
|
352
351
|
it('should export the effective date') do
|
353
|
-
@info_hash[
|
352
|
+
@info_hash[RCAP::CAP_1_2::Info::EFFECTIVE_KEY].should == @info.effective.to_s_for_cap
|
354
353
|
end
|
355
354
|
|
356
355
|
it('should export the onset date') do
|
357
|
-
@info_hash[
|
356
|
+
@info_hash[RCAP::CAP_1_2::Info::ONSET_KEY].should == @info.onset.to_s_for_cap
|
358
357
|
end
|
359
358
|
|
360
359
|
it('should export the expires date') do
|
361
|
-
@info_hash[
|
360
|
+
@info_hash[RCAP::CAP_1_2::Info::EXPIRES_KEY].should == @info.expires.to_s_for_cap
|
362
361
|
end
|
363
362
|
|
364
363
|
it('should export the sender name') do
|
365
|
-
@info_hash[
|
364
|
+
@info_hash[RCAP::CAP_1_2::Info::SENDER_NAME_KEY].should == @info.sender_name
|
366
365
|
end
|
367
366
|
|
368
367
|
it('should export the headline') do
|
369
|
-
@info_hash[
|
368
|
+
@info_hash[RCAP::CAP_1_2::Info::HEADLINE_KEY].should == @info.headline
|
370
369
|
end
|
371
370
|
|
372
371
|
it('should export the description') do
|
373
|
-
@info_hash[
|
372
|
+
@info_hash[RCAP::CAP_1_2::Info::DESCRIPTION_KEY].should == @info.description
|
374
373
|
end
|
375
374
|
|
376
375
|
it('should export the instruction') do
|
377
|
-
@info_hash[
|
376
|
+
@info_hash[RCAP::CAP_1_2::Info::INSTRUCTION_KEY].should == @info.instruction
|
378
377
|
end
|
379
378
|
|
380
379
|
it('should export the web address ') do
|
381
|
-
@info_hash[
|
380
|
+
@info_hash[RCAP::CAP_1_2::Info::WEB_KEY].should == @info.web
|
382
381
|
end
|
383
382
|
|
384
383
|
it('should export the contact') do
|
385
|
-
@info_hash[
|
384
|
+
@info_hash[RCAP::CAP_1_2::Info::CONTACT_KEY].should == @info.contact
|
386
385
|
end
|
387
386
|
|
388
387
|
it('should export the event codes') do
|
389
|
-
@info_hash[
|
388
|
+
@info_hash[RCAP::CAP_1_2::Info::EVENT_CODES_KEY].should == @info.event_codes.map { |event_code| event_code.to_h }
|
390
389
|
end
|
391
390
|
|
392
391
|
it('should export the parameters ') do
|
393
|
-
@info_hash[
|
392
|
+
@info_hash[RCAP::CAP_1_2::Info::PARAMETERS_KEY].should == @info.parameters.map { |parameter| parameter.to_h }
|
394
393
|
end
|
395
394
|
|
396
395
|
it('should export the resources ') do
|
397
|
-
@info_hash[
|
396
|
+
@info_hash[RCAP::CAP_1_2::Info::RESOURCES_KEY].should == @info.resources.map { |resource| resource.to_h }
|
398
397
|
end
|
399
398
|
|
400
399
|
it('should export the areas') do
|
401
|
-
@info_hash[
|
400
|
+
@info_hash[RCAP::CAP_1_2::Info::AREAS_KEY].should == @info.areas.map { |area| area.to_h }
|
402
401
|
end
|
403
402
|
end
|
404
403
|
end
|