airborne 0.2.6 → 0.2.7

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: 2a6aad7b42c7686c2a004890329560447394199c
4
- data.tar.gz: 2130927bdef994ab120c107db557362c549b5e38
3
+ metadata.gz: 0c4e0f0b29e8fe3d447badc110770b6cec76f60e
4
+ data.tar.gz: 36b5b93820d8b1d4f3539f68de440ea672587f52
5
5
  SHA512:
6
- metadata.gz: 98e0e2598548f8f2714320fc8b0ed004397ed1d7c7e49a5d324b01782b4bbf416a98021dc6fb0176d1a8f44109b9918f0ea382ec276a7f6414d3e9eb93bb59d2
7
- data.tar.gz: 4c3abbeb2722b62e016f4836d488675cbcf5f237543c83244e629aaac765ad1a9bbbb61490342655bbdb02a7a29787699cb25230f60d96e19998448b921eb1ea
6
+ metadata.gz: 249972d3a866caf41d82bbbc7499b93149d351022b8d76e1ca6b3d81c750eb73859e8e8d8c0903c72dfa5046b9e16cd79f6fda3bf489b484500324a7a70e32f4
7
+ data.tar.gz: da3fc680bda8e8cfebe0c1e0e6453cdad6e7ab3734c0981fd8406b9e3093124530a925112b0ce3fcd142db360ce34b8d77342eb6d40fad25362a205624641bfa
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'airborne'
3
- s.version = '0.2.6'
3
+ s.version = '0.2.7'
4
4
  s.date = Date.today.to_s
5
5
  s.summary = 'RSpec driven API testing framework'
6
6
  s.authors = ['Alex Friedman', 'Seth Pollack']
@@ -88,7 +88,7 @@ module Airborne
88
88
  expected_value = extract_expected_value(expected, prop)
89
89
  actual_value = extract_actual(actual, prop)
90
90
 
91
- next expect_json_impl(expected_value, actual_value) if hash?(expected_value)
91
+ next expect_json_impl(expected_value, actual_value) if hash?(expected_value) && hash?(actual_value)
92
92
  next expected_value.call(actual_value) if expected_value.is_a?(Proc)
93
93
  next expect(actual_value.to_s).to match(expected_value) if expected_value.is_a?(Regexp)
94
94
 
@@ -41,6 +41,12 @@ describe 'expect_json options' do
41
41
  get '/simple_get'
42
42
  expect{ expect_json(name: 'Alex', other: 'other') }.to raise_error(ExpectationNotMetError)
43
43
  end
44
+
45
+ it 'should require all expected properties' do
46
+ mock_get 'simple_get'
47
+ get '/simple_get'
48
+ expect{ expect_json(name: 'Alex', nested: {}) }.to raise_error(ExpectationNotMetError)
49
+ end
44
50
  end
45
51
 
46
52
  describe 'match_none', match_expected: false, match_actual: false do
@@ -53,7 +59,7 @@ describe 'expect_json options' do
53
59
  it 'should not require the expected properties' do
54
60
  mock_get 'simple_get'
55
61
  get '/simple_get'
56
- expect_json(name: 'Alex', age: 32, address: nil, other: 'other')
62
+ expect_json(name: 'Alex', age: 32, address: nil, other: 'other', nested: {})
57
63
  end
58
64
  end
59
65
  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.6
4
+ version: 0.2.7
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: 2016-08-01 00:00:00.000000000 Z
12
+ date: 2016-08-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec