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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c6dbdb4e4fb42256d136b4fc15bc52604ec7ec55
4
- data.tar.gz: 5babb01a3f583438d337cd63a678d6ddfb522cae
3
+ metadata.gz: 8f1bb8d459481fbacaafd1d72b5849e435ca611c
4
+ data.tar.gz: 2454e521d94443aaae41290fdd798560e14f808c
5
5
  SHA512:
6
- metadata.gz: b531a941356a2861b90aa2abbcc04ce2aa68191dabe6d748275fe4ddb424b350b7ea56dd6cb625d0b3bbe93258f3fea1e20318c3e6ab2769120b0e6699f498ff
7
- data.tar.gz: f702beedc737affede6c4b51531b2ed097b2415afba2c3cc555b4bad43cd11d348dacf71fb7c70247c5eb6fcd0c0a2367a075eaa22a133aa78d855f1c8ad3d13
6
+ metadata.gz: 24a08e05af16617fc9a5cc5d5e11fec8c512d8571281ba162e42ed9834e6307a3611ee3018a1f9a7e270764a89dd8649bdf69124b4ea2d3ce0db175942515dc0
7
+ data.tar.gz: 2f48afa8c36161e387d9800a114e6effc8aa1a9d52b78fb1afb704dddaa4d52e95567cd11c67a726f26ecce8673e75a355a621e0c1b386bb88f3e41b2b132e16
data/README.md CHANGED
@@ -16,8 +16,8 @@ Install Airborne:
16
16
  $ gem install airborne
17
17
  ```
18
18
  Or add it to your Gemfile:
19
- ```shell
20
- $ gem 'airborne'
19
+ ```ruby
20
+ gem 'airborne'
21
21
  ```
22
22
  ##Creating Tests
23
23
 
data/airborne.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'airborne'
3
- s.version = '0.2.1'
3
+ s.version = '0.2.2'
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']
@@ -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.class == Regexp
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.1
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 00:00:00.000000000 Z
12
+ date: 2015-12-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec