jsonapi_spec_helpers 0.2.2 → 0.2.3

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: c95f70b24431c804dc7e611071e2bfb15f702aff
4
- data.tar.gz: daffe460ccef792159feb8379277e12d1af39fbe
3
+ metadata.gz: 319b2470e387e56133c175300436a521422afd02
4
+ data.tar.gz: 3afed12ece44c28fb3133fc238bd26a9ef9f0992
5
5
  SHA512:
6
- metadata.gz: 1d6a4b7cad9ec9b7ccf07d9e187821f4e3cb31aa4c210b9350e86e4b8a98c712e858f8c4b399ddea37f47b9c10b68ea4ff2bb911a3c7792c0cc824856afc0d79
7
- data.tar.gz: 22aeefed1fecb2bfe9eb69437154e66c0d7a54396edaaa336f710e79f04564293cf3f7ce39e27cc537a20459ebacbcecd933b3e58c950517263cdd7644793d4e
6
+ metadata.gz: 3f318974fe29ca4339a596c116b12cda815ba84044ca336555002190c094c67e504d4f55e15b5185ce17c0fff67dc45970c7f9adbb9fca96baa07f45ce93f7f8
7
+ data.tar.gz: 52d3b95df9f5b7ebe4f52c7322ecd92ab5e8776dd3ce85676457944697194e199f01cc5611c9eebd00f3a438eb957ce390d3988b9872abca110573757a9a4bdd
@@ -4,8 +4,13 @@ require 'jsonapi_spec_helpers/payload'
4
4
 
5
5
  RSpec::Matchers.define :match_payload do |attribute, expected|
6
6
  match do |actual|
7
- # cast to_json for things like Time
8
- actual.to_json == expected.to_json
7
+ # cast as_json for things like Time
8
+ # use as_json instead of to_json for things like hashes
9
+ if expected.respond_to?(:as_json)
10
+ actual.as_json == expected.as_json
11
+ else
12
+ actual.to_json == expected.to_json
13
+ end
9
14
  end
10
15
 
11
16
  failure_message do |actual|
@@ -1,3 +1,3 @@
1
1
  module JsonapiSpecHelpers
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsonapi_spec_helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lee Richmond
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-09-25 00:00:00.000000000 Z
11
+ date: 2016-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry
@@ -135,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
135
135
  version: '0'
136
136
  requirements: []
137
137
  rubyforge_project:
138
- rubygems_version: 2.5.1
138
+ rubygems_version: 2.4.5.1
139
139
  signing_key:
140
140
  specification_version: 4
141
141
  summary: Spec helpers for jsonapi