hash_dealer 1.1.2 → 1.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/hash_dealer.gemspec +1 -1
  3. data/lib/matcher.rb +17 -0
  4. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.2
1
+ 1.1.3
data/hash_dealer.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{hash_dealer}
8
- s.version = "1.1.2"
8
+ s.version = "1.1.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Dan Langevin"]
data/lib/matcher.rb CHANGED
@@ -15,4 +15,21 @@ RSpec::Matchers.define(:match_response) do |actual|
15
15
  "expected #{PathString.as_sorted_json(actual)}\n not to equal\n #{PathString.as_sorted_json(container)}"
16
16
  end
17
17
 
18
+ end
19
+
20
+ # alias as match_json
21
+ RSpec::Matchers.define(:match_json) do |actual|
22
+
23
+ match do |expected|
24
+ PathString.as_sorted_json(actual) == PathString.as_sorted_json(expected)
25
+ end
26
+
27
+ failure_message_for_should do |container|
28
+ "expected #{PathString.as_sorted_json(actual)}\n to equal\n #{PathString.as_sorted_json(container)}"
29
+ end
30
+
31
+ failure_message_for_should_not do |container|
32
+ "expected #{PathString.as_sorted_json(actual)}\n not to equal\n #{PathString.as_sorted_json(container)}"
33
+ end
34
+
18
35
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: hash_dealer
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.1.2
5
+ version: 1.1.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - Dan Langevin
@@ -129,7 +129,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
129
129
  requirements:
130
130
  - - ">="
131
131
  - !ruby/object:Gem::Version
132
- hash: 1622066731891646773
132
+ hash: 531561907666267100
133
133
  segments:
134
134
  - 0
135
135
  version: "0"