airborne 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 67b6c4aa3a5074c42780d4b4bb30797974f34a29
|
4
|
+
data.tar.gz: 861430f53bbd74076c161d4f6a0fa3e392b143e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9fc7bdf5b0da1a85f9c6a72692b2b5966bebfcadbfeb647f3fe256e63656bd5c7ef24033ac5b6299305af8625b630c5a4d686a021e9ba964d0cd9d7319b8560
|
7
|
+
data.tar.gz: a08ff15e1f22d82cca5c7685ea4114c8c6399c7c6742f6b8d1740e3662fd314e47ba3c32fb7a6caa778f1f262736b748d65fa410a24e1bf401a9c364fd65c33f
|
data/airborne.gemspec
CHANGED
@@ -124,7 +124,7 @@ module Airborne
|
|
124
124
|
|
125
125
|
type_string = type.to_s
|
126
126
|
|
127
|
-
if type_string.include?('array_of') && !type_string.include?('or_null')
|
127
|
+
if type_string.include?('array_of') && !(type_string.include?('or_null') && value.nil?)
|
128
128
|
check_array_types(value, val_class, prop, type)
|
129
129
|
else
|
130
130
|
expect_type(type, val_class, prop)
|
@@ -38,17 +38,31 @@ describe 'expect_json_types' do
|
|
38
38
|
end
|
39
39
|
|
40
40
|
it "should allow array of types to be null" do
|
41
|
-
mock_get('
|
42
|
-
get '/
|
43
|
-
expect_json_types(
|
44
|
-
expect_json_types(
|
45
|
-
expect_json_types(
|
46
|
-
expect_json_types(
|
47
|
-
expect_json_types(
|
48
|
-
expect_json_types(
|
49
|
-
expect_json_types(
|
50
|
-
expect_json_types(
|
51
|
-
expect_json_types(
|
41
|
+
mock_get('array_of_types')
|
42
|
+
get '/array_of_types'
|
43
|
+
expect_json_types(nil_array: :array_or_null)
|
44
|
+
expect_json_types(nil_array: :array_of_integers_or_null)
|
45
|
+
expect_json_types(nil_array: :array_of_ints_or_null)
|
46
|
+
expect_json_types(nil_array: :array_of_floats_or_null)
|
47
|
+
expect_json_types(nil_array: :array_of_strings_or_null)
|
48
|
+
expect_json_types(nil_array: :array_of_booleans_or_null)
|
49
|
+
expect_json_types(nil_array: :array_of_bools_or_null)
|
50
|
+
expect_json_types(nil_array: :array_of_objects_or_null)
|
51
|
+
expect_json_types(nil_array: :array_of_arrays_or_null)
|
52
|
+
end
|
53
|
+
|
54
|
+
it "should check array types when not null" do
|
55
|
+
mock_get('array_of_types')
|
56
|
+
get '/array_of_types'
|
57
|
+
expect_json_types(array_of_ints: :array_or_null)
|
58
|
+
expect_json_types(array_of_ints: :array_of_integers_or_null)
|
59
|
+
expect_json_types(array_of_ints: :array_of_ints_or_null)
|
60
|
+
expect_json_types(array_of_floats: :array_of_floats_or_null)
|
61
|
+
expect_json_types(array_of_strings: :array_of_strings_or_null)
|
62
|
+
expect_json_types(array_of_bools: :array_of_booleans_or_null)
|
63
|
+
expect_json_types(array_of_bools: :array_of_bools_or_null)
|
64
|
+
expect_json_types(array_of_objects: :array_of_objects_or_null)
|
65
|
+
expect_json_types(array_of_arrays: :array_of_arrays_or_null)
|
52
66
|
end
|
53
67
|
|
54
68
|
it 'should allow empty array' do
|
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.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Friedman
|
@@ -151,6 +151,7 @@ files:
|
|
151
151
|
- spec/airborne/rack/rack_sinatra_spec.rb
|
152
152
|
- spec/spec_helper.rb
|
153
153
|
- spec/stub_helper.rb
|
154
|
+
- spec/test_responses/array_of_types.json
|
154
155
|
- spec/test_responses/array_of_values.json
|
155
156
|
- spec/test_responses/array_response.json
|
156
157
|
- spec/test_responses/array_with_index.json
|