airborne 0.2.11 → 0.2.12
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c07d38bc345ad7e0ce8ad75b082d7bc03164e366
|
4
|
+
data.tar.gz: 03c380223cfd705875f0c9b0606dba3d1bde0f78
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e17756d80dc4ee9e6fcf21e5afc5e0b8593bb3a87dac08588c7a9bceb08d87ba313f44d374b93dad7607ce8ac48bd0f6c074b4efb5c2fa68e9892cc7778cc0fb
|
7
|
+
data.tar.gz: 2e0385cc539038f6f8ce637b636d0906e8be4e05f628dbcff8fc23cb6a5f1122d992ae4c8abdf4bfb052188fc249b7665f53aec23621bdb778fbffda4febe007
|
data/airborne.gemspec
CHANGED
@@ -101,7 +101,7 @@ module Airborne
|
|
101
101
|
|
102
102
|
@mapper ||= get_mapper
|
103
103
|
|
104
|
-
actual = convert_to_date(actual) if expected == :date
|
104
|
+
actual = convert_to_date(actual) if ((expected == :date) || (expected == :date_or_null))
|
105
105
|
|
106
106
|
return expect_type(expected, actual) if expected.is_a?(Symbol)
|
107
107
|
return expected.call(actual) if expected.is_a?(Proc)
|
@@ -115,7 +115,7 @@ module Airborne
|
|
115
115
|
keys.flatten.uniq.each do |prop|
|
116
116
|
type = extract_expected_type(expected, prop)
|
117
117
|
value = extract_actual(actual, prop)
|
118
|
-
value = convert_to_date(value) if type == :date
|
118
|
+
value = convert_to_date(value) if ((type == :date) || (type == :date_or_null))
|
119
119
|
|
120
120
|
next expect_json_types_impl(type, value) if hash?(type)
|
121
121
|
next type.call(value) if type.is_a?(Proc)
|
@@ -24,3 +24,29 @@ describe 'expect_json with date' do
|
|
24
24
|
expect_json(createdAt: date { |value| expect(value).to be_between(prev_day, next_day) })
|
25
25
|
end
|
26
26
|
end
|
27
|
+
|
28
|
+
describe 'expect_json_types with date_or_null' do
|
29
|
+
it 'should verify date_or_null when date is null' do
|
30
|
+
mock_get('date_is_null_response')
|
31
|
+
get '/date_is_null_response'
|
32
|
+
expect_json_types(dateDeleted: :date_or_null)
|
33
|
+
end
|
34
|
+
|
35
|
+
it 'should verify date_or_null when date is null with path' do
|
36
|
+
mock_get('date_is_null_response')
|
37
|
+
get '/date_is_null_response'
|
38
|
+
expect_json_types('dateDeleted', :date_or_null)
|
39
|
+
end
|
40
|
+
|
41
|
+
it 'should verify date_or_null with date' do
|
42
|
+
mock_get('date_response')
|
43
|
+
get '/date_response'
|
44
|
+
expect_json_types(createdAt: :date_or_null)
|
45
|
+
end
|
46
|
+
|
47
|
+
it 'should verify date_or_null with date with path' do
|
48
|
+
mock_get('date_response')
|
49
|
+
get '/date_response'
|
50
|
+
expect_json_types('createdAt', :date_or_null)
|
51
|
+
end
|
52
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: airborne
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Friedman
|
@@ -166,6 +166,7 @@ files:
|
|
166
166
|
- spec/test_responses/array_with_nested.json
|
167
167
|
- spec/test_responses/array_with_nested_bad_data.json
|
168
168
|
- spec/test_responses/array_with_partial_nested.json
|
169
|
+
- spec/test_responses/date_is_null_response.json
|
169
170
|
- spec/test_responses/date_response.json
|
170
171
|
- spec/test_responses/hash_property.json
|
171
172
|
- spec/test_responses/invalid_get.json
|