rcap 2.5.0 → 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 +5 -5
- data/.ruby-version +1 -0
- data/CHANGELOG.md +18 -0
- data/README.md +1 -0
- data/lib/rcap.rb +3 -1
- data/lib/rcap/alert.rb +4 -2
- data/lib/rcap/base/alert.rb +70 -73
- data/lib/rcap/base/area.rb +19 -13
- data/lib/rcap/base/circle.rb +15 -4
- data/lib/rcap/base/event_code.rb +2 -0
- data/lib/rcap/base/geocode.rb +2 -0
- data/lib/rcap/base/info.rb +81 -75
- data/lib/rcap/base/parameter.rb +8 -6
- data/lib/rcap/base/point.rb +4 -2
- data/lib/rcap/base/polygon.rb +16 -8
- data/lib/rcap/base/resource.rb +13 -13
- data/lib/rcap/cap_1_0/alert.rb +36 -39
- data/lib/rcap/cap_1_0/area.rb +2 -0
- data/lib/rcap/cap_1_0/circle.rb +2 -0
- data/lib/rcap/cap_1_0/event_code.rb +3 -1
- data/lib/rcap/cap_1_0/geocode.rb +3 -1
- data/lib/rcap/cap_1_0/info.rb +3 -1
- data/lib/rcap/cap_1_0/parameter.rb +3 -2
- data/lib/rcap/cap_1_0/point.rb +2 -0
- data/lib/rcap/cap_1_0/polygon.rb +3 -1
- data/lib/rcap/cap_1_0/resource.rb +2 -0
- data/lib/rcap/cap_1_1/alert.rb +4 -2
- data/lib/rcap/cap_1_1/area.rb +2 -0
- data/lib/rcap/cap_1_1/circle.rb +2 -0
- data/lib/rcap/cap_1_1/event_code.rb +3 -1
- data/lib/rcap/cap_1_1/geocode.rb +3 -1
- data/lib/rcap/cap_1_1/info.rb +48 -46
- data/lib/rcap/cap_1_1/parameter.rb +2 -1
- data/lib/rcap/cap_1_1/point.rb +2 -0
- data/lib/rcap/cap_1_1/polygon.rb +3 -1
- data/lib/rcap/cap_1_1/resource.rb +12 -11
- data/lib/rcap/cap_1_2/alert.rb +4 -2
- data/lib/rcap/cap_1_2/area.rb +2 -0
- data/lib/rcap/cap_1_2/circle.rb +2 -0
- data/lib/rcap/cap_1_2/event_code.rb +3 -1
- data/lib/rcap/cap_1_2/geocode.rb +3 -1
- data/lib/rcap/cap_1_2/info.rb +55 -51
- data/lib/rcap/cap_1_2/parameter.rb +2 -1
- data/lib/rcap/cap_1_2/point.rb +2 -0
- data/lib/rcap/cap_1_2/polygon.rb +4 -2
- data/lib/rcap/cap_1_2/resource.rb +14 -12
- data/lib/rcap/config.rb +2 -0
- data/lib/rcap/custom_validators.rb +30 -27
- data/lib/rcap/extensions/array.rb +2 -0
- data/lib/rcap/extensions/date.rb +3 -1
- data/lib/rcap/extensions/date_time.rb +4 -1
- data/lib/rcap/extensions/float.rb +2 -0
- data/lib/rcap/extensions/integer.rb +7 -0
- data/lib/rcap/extensions/nil_class.rb +2 -0
- data/lib/rcap/extensions/string.rb +3 -1
- data/lib/rcap/extensions/time.rb +3 -0
- data/lib/rcap/formatters/yaml.rb +5 -0
- data/lib/rcap/info.rb +2 -0
- data/lib/rcap/utilities.rb +8 -10
- data/lib/rcap/validation.rb +19 -14
- data/lib/rcap/version.rb +3 -1
- data/rcap.gemspec +5 -5
- 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/circle_spec.rb +9 -0
- 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/polygon_spec.rb +7 -5
- 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/circle_spec.rb +9 -0
- 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/polygon_spec.rb +12 -10
- data/spec/cap_1_1/resource_spec.rb +13 -13
- 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/circle_spec.rb +9 -0
- data/spec/cap_1_2/info_spec.rb +25 -26
- data/spec/cap_1_2/polygon_spec.rb +8 -0
- data/spec/cap_1_2/resource_spec.rb +13 -13
- data/spec/extensions_spec.rb +2 -2
- data/spec/spec_helper.rb +2 -2
- data/spec/validations_spec.rb +0 -1
- metadata +15 -15
- data/lib/rcap/extensions/fixnum.rb +0 -5
data/lib/rcap/extensions/date.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
class DateTime
|
2
|
-
|
4
|
+
alias inspect to_s
|
3
5
|
|
4
6
|
# Returns a string representaion of the time suitable for CAP.
|
5
7
|
# @return [String]
|
@@ -15,6 +17,7 @@ class DateTime
|
|
15
17
|
end
|
16
18
|
|
17
19
|
private
|
20
|
+
|
18
21
|
def utc_hours_offset
|
19
22
|
offset * 24
|
20
23
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
class String
|
2
4
|
CAP_LIST_REGEX = Regexp.new('"([\w\s]+)"|(\S+)')
|
3
5
|
WHITESPACE_REGEX = Regexp.new('^\s+$')
|
@@ -10,7 +12,7 @@ class String
|
|
10
12
|
# "one".for_cap_list # => "one"
|
11
13
|
# "two words".for_cap_list # => "\"two words\""
|
12
14
|
def for_cap_list
|
13
|
-
if
|
15
|
+
if /\s/.match?(self)
|
14
16
|
'"' + self + '"'
|
15
17
|
else
|
16
18
|
self
|
data/lib/rcap/extensions/time.rb
CHANGED
data/lib/rcap/info.rb
CHANGED
data/lib/rcap/utilities.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
ALLOWED_CHARACTERS = /[^\s&<]+/.freeze
|
2
4
|
|
3
5
|
module RCAP
|
4
6
|
# Returns a randomly generated UUID string
|
@@ -17,7 +19,7 @@ module RCAP
|
|
17
19
|
# @return [String,nil] Text content of element matching XPath query or nil
|
18
20
|
def self.xpath_text(xml_element, xpath, namespace)
|
19
21
|
element = xpath_first(xml_element, xpath, namespace)
|
20
|
-
element.text.strip if element
|
22
|
+
element.text.strip if element&.text
|
21
23
|
end
|
22
24
|
|
23
25
|
# Returns first descendent that matches the given XPath expression.
|
@@ -60,8 +62,8 @@ module RCAP
|
|
60
62
|
max_line_length = inspect_string.lines.map { |line| line.strip.length }.max
|
61
63
|
"\n." + '-' * (max_line_length + 2) + ".\n"\
|
62
64
|
'| ' + header.ljust(max_line_length) + " |\n"\
|
63
|
-
'|' + '-' * (
|
64
|
-
"'" + '-' * (
|
65
|
+
'|' + '-' * (max_line_length + 2) + "|\n" + inspect_string.lines.map { |line| '| ' + line.strip.ljust(max_line_length) + ' |' }.join("\n") + "\n" \
|
66
|
+
"'" + '-' * (max_line_length + 2) + "'\n"
|
65
67
|
end
|
66
68
|
|
67
69
|
# Converts an array of key value pairs into a hash, excluding any value that is nil.
|
@@ -96,9 +98,7 @@ module RCAP
|
|
96
98
|
def self.parse_datetime(date)
|
97
99
|
case date
|
98
100
|
when String
|
99
|
-
unless
|
100
|
-
DateTime.parse(date.strip)
|
101
|
-
end
|
101
|
+
DateTime.parse(date.strip) unless date.empty?
|
102
102
|
when DateTime, Time, Date
|
103
103
|
date.to_datetime
|
104
104
|
end
|
@@ -122,9 +122,7 @@ module RCAP
|
|
122
122
|
# @param [String] string
|
123
123
|
# @return [String,nil]
|
124
124
|
def self.strip_if_given(string)
|
125
|
-
|
126
|
-
string.strip
|
127
|
-
end
|
125
|
+
string&.strip
|
128
126
|
end
|
129
127
|
|
130
128
|
# if the string is given, String#strip and then String#to_f are applied
|
data/lib/rcap/validation.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# This file is ripped directly from the no-longer-maintained assistance gem. Other code in that gem
|
2
4
|
# was causing issues, so I'm putting the needed code directly in rcap as a workaround.
|
3
5
|
|
@@ -62,7 +64,7 @@ module Validation
|
|
62
64
|
def on(att)
|
63
65
|
@errors[att]
|
64
66
|
end
|
65
|
-
|
67
|
+
alias [] on
|
66
68
|
|
67
69
|
# Adds an error for the given attribute.
|
68
70
|
def add(att, msg)
|
@@ -71,9 +73,9 @@ module Validation
|
|
71
73
|
|
72
74
|
# Returns an array of fully-formatted error messages.
|
73
75
|
def full_messages
|
74
|
-
@errors.
|
75
|
-
|
76
|
-
|
76
|
+
@errors.each_with_object([]) do |kv, m|
|
77
|
+
att, errors = *kv
|
78
|
+
errors.each { |e| m << "#{att} #{e}" }
|
77
79
|
end
|
78
80
|
end
|
79
81
|
end
|
@@ -128,9 +130,7 @@ module Validation
|
|
128
130
|
|
129
131
|
# Validates the given instance.
|
130
132
|
def validate(o)
|
131
|
-
if superclass.respond_to?(:validate) && !@skip_superclass_validations
|
132
|
-
superclass.validate(o)
|
133
|
-
end
|
133
|
+
superclass.validate(o) if superclass.respond_to?(:validate) && !@skip_superclass_validations
|
134
134
|
validations.each do |att, procs|
|
135
135
|
v = o.send(att)
|
136
136
|
procs.each { |p| p[o, att, v] }
|
@@ -162,6 +162,7 @@ module Validation
|
|
162
162
|
|
163
163
|
validates_each(*atts) do |o, a, v|
|
164
164
|
next if (v.nil? && opts[:allow_nil]) || (v.blank? && opts[:allow_blank])
|
165
|
+
|
165
166
|
o.errors[a] << opts[:message] unless v == opts[:accept]
|
166
167
|
end
|
167
168
|
end
|
@@ -169,11 +170,12 @@ module Validation
|
|
169
170
|
# Validates confirmation of an attribute.
|
170
171
|
def validates_confirmation_of(*atts)
|
171
172
|
opts = {
|
172
|
-
message: 'is not confirmed'
|
173
|
+
message: 'is not confirmed'
|
173
174
|
}.merge!(atts.extract_options!)
|
174
175
|
|
175
176
|
validates_each(*atts) do |o, a, v|
|
176
177
|
next if (v.nil? && opts[:allow_nil]) || (v.blank? && opts[:allow_blank])
|
178
|
+
|
177
179
|
c = o.send(:"#{a}_confirmation")
|
178
180
|
o.errors[a] << opts[:message] unless v == c
|
179
181
|
end
|
@@ -182,15 +184,16 @@ module Validation
|
|
182
184
|
# Validates the format of an attribute.
|
183
185
|
def validates_format_of(*atts)
|
184
186
|
opts = {
|
185
|
-
message: 'is invalid'
|
187
|
+
message: 'is invalid'
|
186
188
|
}.merge!(atts.extract_options!)
|
187
189
|
|
188
190
|
unless opts[:with].is_a?(Regexp)
|
189
|
-
|
191
|
+
raise ArgumentError, 'A regular expression must be supplied as the :with option of the options hash'
|
190
192
|
end
|
191
193
|
|
192
194
|
validates_each(*atts) do |o, a, v|
|
193
195
|
next if (v.nil? && opts[:allow_nil]) || (v.blank? && opts[:allow_blank])
|
196
|
+
|
194
197
|
o.errors[a] << opts[:message] unless v.to_s =~ opts[:with]
|
195
198
|
end
|
196
199
|
end
|
@@ -205,6 +208,7 @@ module Validation
|
|
205
208
|
|
206
209
|
validates_each(*atts) do |o, a, v|
|
207
210
|
next if (v.nil? && opts[:allow_nil]) || (v.blank? && opts[:allow_blank])
|
211
|
+
|
208
212
|
if m = opts[:maximum]
|
209
213
|
o.errors[a] << (opts[:message] || opts[:too_long]) unless v && v.size <= m
|
210
214
|
end
|
@@ -220,19 +224,20 @@ module Validation
|
|
220
224
|
end
|
221
225
|
end
|
222
226
|
|
223
|
-
NUMBER_RE = /^\d*\.{0,1}\d
|
224
|
-
INTEGER_RE = /\A[+-]?\d+\Z
|
227
|
+
NUMBER_RE = /^\d*\.{0,1}\d+$/.freeze
|
228
|
+
INTEGER_RE = /\A[+-]?\d+\Z/.freeze
|
225
229
|
|
226
230
|
# Validates whether an attribute is a number.
|
227
231
|
def validates_numericality_of(*atts)
|
228
232
|
opts = {
|
229
|
-
message: 'is not a number'
|
233
|
+
message: 'is not a number'
|
230
234
|
}.merge!(atts.extract_options!)
|
231
235
|
|
232
236
|
re = opts[:only_integer] ? INTEGER_RE : NUMBER_RE
|
233
237
|
|
234
238
|
validates_each(*atts) do |o, a, v|
|
235
239
|
next if (v.nil? && opts[:allow_nil]) || (v.blank? && opts[:allow_blank])
|
240
|
+
|
236
241
|
o.errors[a] << opts[:message] unless v.to_s =~ re
|
237
242
|
end
|
238
243
|
end
|
@@ -240,7 +245,7 @@ module Validation
|
|
240
245
|
# Validates the presence of an attribute.
|
241
246
|
def validates_presence_of(*atts)
|
242
247
|
opts = {
|
243
|
-
message: 'is not present'
|
248
|
+
message: 'is not present'
|
244
249
|
}.merge!(atts.extract_options!)
|
245
250
|
|
246
251
|
validates_each(*atts) do |o, a, v|
|
data/lib/rcap/version.rb
CHANGED
data/rcap.gemspec
CHANGED
@@ -20,10 +20,10 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.require_paths = ['lib']
|
21
21
|
|
22
22
|
s.extra_rdoc_files = ['README.md','CHANGELOG.md']
|
23
|
-
s.add_dependency('json'
|
24
|
-
s.add_dependency('uuidtools'
|
23
|
+
s.add_dependency('json')
|
24
|
+
s.add_dependency('uuidtools')
|
25
25
|
|
26
|
-
s.add_development_dependency(
|
27
|
-
s.add_development_dependency(
|
28
|
-
s.add_development_dependency(
|
26
|
+
s.add_development_dependency('rspec')
|
27
|
+
s.add_development_dependency('yard')
|
28
|
+
s.add_development_dependency('webmock')
|
29
29
|
end
|
data/spec/alert_spec.rb
CHANGED
@@ -2,7 +2,6 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe(RCAP::Alert) do
|
4
4
|
describe('initialising') do
|
5
|
-
|
6
5
|
context('a CAP 1.0 alert') do
|
7
6
|
before(:each) do
|
8
7
|
@original_alert = RCAP::CAP_1_0::Alert.new do |alert|
|
@@ -15,14 +14,14 @@ describe(RCAP::Alert) do
|
|
15
14
|
['Address 1', 'Address 2'].each do |address|
|
16
15
|
alert.addresses << address
|
17
16
|
end
|
18
|
-
%w
|
17
|
+
%w[Code1 Code2].each do |code|
|
19
18
|
alert.codes << code
|
20
19
|
end
|
21
20
|
alert.note = 'Note'
|
22
21
|
['1.0,1', '1.0,2'].each do |reference|
|
23
22
|
alert.references << reference
|
24
23
|
end
|
25
|
-
%w
|
24
|
+
%w[Incident1 Incident2].each do |incident|
|
26
25
|
alert.incidents << incident
|
27
26
|
end
|
28
27
|
2.times { alert.add_info }
|
@@ -87,14 +86,14 @@ describe(RCAP::Alert) do
|
|
87
86
|
['Address 1', 'Address 2'].each do |address|
|
88
87
|
alert.addresses << address
|
89
88
|
end
|
90
|
-
%w
|
89
|
+
%w[Code1 Code2].each do |code|
|
91
90
|
alert.codes << code
|
92
91
|
end
|
93
92
|
alert.note = 'Note'
|
94
93
|
['1,1,1', '1,1,2'].each do |reference|
|
95
94
|
alert.references << reference
|
96
95
|
end
|
97
|
-
%w
|
96
|
+
%w[Incident1 Incident2].each do |incident|
|
98
97
|
alert.incidents << incident
|
99
98
|
end
|
100
99
|
2.times { alert.add_info }
|
@@ -102,7 +101,7 @@ describe(RCAP::Alert) do
|
|
102
101
|
end
|
103
102
|
|
104
103
|
shared_examples_for('it has parsed a CAP 1.1 alert correctly') do
|
105
|
-
it('should use the correct CAP Version') { @alert.class.should
|
104
|
+
it('should use the correct CAP Version') { @alert.class.should == RCAP::CAP_1_1::Alert }
|
106
105
|
it('should parse identifier correctly') { @alert.identifier.should == @original_alert.identifier }
|
107
106
|
it('should parse sender correctly') { @alert.sender.should == @original_alert.sender }
|
108
107
|
it('should parse sent correctly') { @alert.sent.should(be_within(1).of(@original_alert.sent)) }
|
@@ -159,14 +158,14 @@ describe(RCAP::Alert) do
|
|
159
158
|
['Address 1', 'Address 2'].each do |address|
|
160
159
|
alert.addresses << address
|
161
160
|
end
|
162
|
-
%w
|
161
|
+
%w[Code1 Code2].each do |code|
|
163
162
|
alert.codes << code
|
164
163
|
end
|
165
164
|
alert.note = 'Note'
|
166
165
|
['1,1,1', '1,1,2'].each do |reference|
|
167
166
|
alert.references << reference
|
168
167
|
end
|
169
|
-
%w
|
168
|
+
%w[Incident1 Incident2].each do |incident|
|
170
169
|
alert.incidents << incident
|
171
170
|
end
|
172
171
|
2.times { alert.add_info }
|
@@ -174,7 +173,7 @@ describe(RCAP::Alert) do
|
|
174
173
|
end
|
175
174
|
|
176
175
|
shared_examples_for('it has parsed a CAP 1.2 alert correctly') do
|
177
|
-
it('should use the correct CAP Version') { @alert.class.should
|
176
|
+
it('should use the correct CAP Version') { @alert.class.should == RCAP::CAP_1_2::Alert }
|
178
177
|
it('should parse identifier correctly') { @alert.identifier.should == @original_alert.identifier }
|
179
178
|
it('should parse sender correctly') { @alert.sender.should == @original_alert.sender }
|
180
179
|
it('should parse sent correctly') { @alert.sent.should(be_within(1).of(@original_alert.sent)) }
|
data/spec/cap_1_0/alert_spec.rb
CHANGED
@@ -2,7 +2,7 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe(RCAP::CAP_1_0::Alert) do
|
4
4
|
context('on initialisation') do
|
5
|
-
before(:each)
|
5
|
+
before(:each) do
|
6
6
|
@alert = RCAP::CAP_1_0::Alert.new
|
7
7
|
|
8
8
|
@original_alert = RCAP::CAP_1_0::Alert.new do |alert|
|
@@ -15,17 +15,17 @@ describe(RCAP::CAP_1_0::Alert) do
|
|
15
15
|
['Address 1', 'Address 2'].each do |address|
|
16
16
|
alert.addresses << address
|
17
17
|
end
|
18
|
-
%w
|
18
|
+
%w[Code1 Code2].each do |code|
|
19
19
|
alert.codes << code
|
20
20
|
end
|
21
21
|
alert.note = 'Note'
|
22
|
-
%w
|
22
|
+
%w[Sender1 Sender2].each do |sender|
|
23
23
|
a = RCAP::CAP_1_0::Alert.new do |a|
|
24
24
|
a.sender = sender
|
25
25
|
end
|
26
26
|
alert.references << a.to_reference
|
27
27
|
end
|
28
|
-
%w
|
28
|
+
%w[Incident1 Incident2].each do |incident|
|
29
29
|
alert.incidents << incident
|
30
30
|
end
|
31
31
|
2.times { alert.add_info }
|
@@ -75,7 +75,6 @@ describe(RCAP::CAP_1_0::Alert) do
|
|
75
75
|
end
|
76
76
|
|
77
77
|
it_should_behave_like('a successfully parsed CAP 1.0 alert')
|
78
|
-
|
79
78
|
end
|
80
79
|
|
81
80
|
context('from YAML') do
|
data/spec/cap_1_0/area_spec.rb
CHANGED
@@ -66,9 +66,8 @@ describe(RCAP::CAP_1_0::Area) do
|
|
66
66
|
|
67
67
|
context('from XML') do
|
68
68
|
before(:each) do
|
69
|
-
|
70
69
|
@alert = RCAP::CAP_1_0::Alert.new
|
71
|
-
@alert.add_info.areas <<
|
70
|
+
@alert.add_info.areas << @original_area
|
72
71
|
@xml_string = @alert.to_xml
|
73
72
|
@xml_document = REXML::Document.new(@xml_string)
|
74
73
|
@info_xml_element = RCAP.xpath_first(@xml_document.root, RCAP::CAP_1_0::Info::XPATH, RCAP::CAP_1_0::Alert::XMLNS)
|
@@ -81,7 +80,6 @@ describe(RCAP::CAP_1_0::Area) do
|
|
81
80
|
|
82
81
|
context('from YAML Data') do
|
83
82
|
before(:each) do
|
84
|
-
|
85
83
|
@area = RCAP::CAP_1_0::Area.from_yaml_data(YAML.load(@original_area.to_yaml))
|
86
84
|
end
|
87
85
|
|
@@ -90,7 +88,6 @@ describe(RCAP::CAP_1_0::Area) do
|
|
90
88
|
|
91
89
|
context('from a hash') do
|
92
90
|
before(:each) do
|
93
|
-
|
94
91
|
@area = RCAP::CAP_1_0::Area.from_h(@original_area.to_h)
|
95
92
|
end
|
96
93
|
|
@@ -129,27 +126,27 @@ describe(RCAP::CAP_1_0::Area) do
|
|
129
126
|
end
|
130
127
|
|
131
128
|
it('should export the area description correctly') do
|
132
|
-
@area_hash[
|
129
|
+
@area_hash[RCAP::CAP_1_0::Area::AREA_DESC_KEY].should == @area.area_desc
|
133
130
|
end
|
134
131
|
|
135
132
|
it('should export the altitude correctly') do
|
136
|
-
@area_hash[
|
133
|
+
@area_hash[RCAP::CAP_1_0::Area::ALTITUDE_KEY].should == @area.altitude
|
137
134
|
end
|
138
135
|
|
139
136
|
it('should set the ceiling correctly') do
|
140
|
-
@area_hash[
|
137
|
+
@area_hash[RCAP::CAP_1_0::Area::CEILING_KEY].should == @area.ceiling
|
141
138
|
end
|
142
139
|
|
143
140
|
it('should export the circles correctly') do
|
144
|
-
@area_hash[
|
141
|
+
@area_hash[RCAP::CAP_1_0::Area::CIRCLES_KEY].should == @area.circles.map { |circle| circle.to_a }
|
145
142
|
end
|
146
143
|
|
147
144
|
it('should export the geocodes correctly') do
|
148
|
-
@area_hash[
|
145
|
+
@area_hash[RCAP::CAP_1_0::Area::GEOCODES_KEY].should == @area.geocodes.map { |geocode| geocode.to_h }
|
149
146
|
end
|
150
147
|
|
151
148
|
it('should export the polygons correctly') do
|
152
|
-
@area_hash[
|
149
|
+
@area_hash[RCAP::CAP_1_0::Area::POLYGONS_KEY].should == @area.polygons.map { |polygon| polygon.to_h }
|
153
150
|
end
|
154
151
|
end
|
155
152
|
end
|