airborne 0.2.1 → 0.2.2
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/README.md +2 -2
- data/airborne.gemspec +1 -1
- data/lib/airborne/request_expectations.rb +2 -2
- data/spec/airborne/expectations/expect_json_spec.rb +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f1bb8d459481fbacaafd1d72b5849e435ca611c
|
4
|
+
data.tar.gz: 2454e521d94443aaae41290fdd798560e14f808c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 24a08e05af16617fc9a5cc5d5e11fec8c512d8571281ba162e42ed9834e6307a3611ee3018a1f9a7e270764a89dd8649bdf69124b4ea2d3ce0db175942515dc0
|
7
|
+
data.tar.gz: 2f48afa8c36161e387d9800a114e6effc8aa1a9d52b78fb1afb704dddaa4d52e95567cd11c67a726f26ecce8673e75a355a621e0c1b386bb88f3e41b2b132e16
|
data/README.md
CHANGED
data/airborne.gemspec
CHANGED
@@ -74,7 +74,7 @@ module Airborne
|
|
74
74
|
def expect_json_impl(expected, actual)
|
75
75
|
return if nil_optional_hash?(expected, actual)
|
76
76
|
|
77
|
-
actual = actual.to_s if expected.
|
77
|
+
actual = actual.to_s if expected.is_a?(Regexp)
|
78
78
|
|
79
79
|
return expect(actual).to match(expected) if property?(expected)
|
80
80
|
|
@@ -229,7 +229,7 @@ module Airborne
|
|
229
229
|
end
|
230
230
|
|
231
231
|
def property?(expectations)
|
232
|
-
[String, Regexp, Float, Fixnum, Bignum, TrueClass, FalseClass, NilClass].include?(expectations.class)
|
232
|
+
[String, Regexp, Float, Fixnum, Bignum, TrueClass, FalseClass, NilClass, Array].include?(expectations.class)
|
233
233
|
end
|
234
234
|
|
235
235
|
def get_mapper
|
@@ -7,6 +7,12 @@ describe 'expect_json' do
|
|
7
7
|
expect_json(name: 'Alex', age: 32)
|
8
8
|
end
|
9
9
|
|
10
|
+
it 'should allow array response' do
|
11
|
+
mock_get('array_response')
|
12
|
+
get '/array_response'
|
13
|
+
expect_json([{ name: 'Seth' }])
|
14
|
+
end
|
15
|
+
|
10
16
|
it 'should fail when incorrect json is tested' do
|
11
17
|
mock_get('simple_get')
|
12
18
|
get '/simple_get'
|
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.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Friedman
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-12-
|
12
|
+
date: 2015-12-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|