hash_dealer 1.4.1 → 1.4.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.
- data/VERSION +1 -1
- data/hash_dealer.gemspec +1 -1
- data/lib/core_extensions.rb +4 -0
- data/lib/matcher.rb +28 -4
- metadata +2 -2
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.4.
|
|
1
|
+
1.4.2
|
data/hash_dealer.gemspec
CHANGED
data/lib/core_extensions.rb
CHANGED
data/lib/matcher.rb
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
require 'rspec'
|
|
3
3
|
require 'pp'
|
|
4
4
|
|
|
5
|
+
|
|
6
|
+
def print_diff(diff, depth = 1)
|
|
7
|
+
puts "#{"\t" * depth}" + "HashDealer::#{diff.first.to_s}".bold.cyan + "\tResponse::#{diff.last.to_s}".bold.yellow if diff.is_a?(Array)
|
|
8
|
+
if diff.is_a?(Hash)
|
|
9
|
+
diff.each_pair do |k, v|
|
|
10
|
+
puts "\n"
|
|
11
|
+
puts (("\t" * depth) + k).red
|
|
12
|
+
print_diff(v, depth + 1)
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
5
17
|
RSpec::Matchers.define(:match_response) do |actual|
|
|
6
18
|
|
|
7
19
|
actual = Comparator.normalize_value(actual)
|
|
@@ -13,11 +25,17 @@ RSpec::Matchers.define(:match_response) do |actual|
|
|
|
13
25
|
end
|
|
14
26
|
|
|
15
27
|
failure_message_for_should do |container|
|
|
16
|
-
|
|
28
|
+
puts "\n"
|
|
29
|
+
print_diff(@diff)
|
|
30
|
+
puts "\n"
|
|
31
|
+
""
|
|
17
32
|
end
|
|
18
33
|
|
|
19
34
|
failure_message_for_should_not do |container|
|
|
20
|
-
|
|
35
|
+
puts "\n"
|
|
36
|
+
print_diff(@diff)
|
|
37
|
+
puts "\n"
|
|
38
|
+
""
|
|
21
39
|
end
|
|
22
40
|
end
|
|
23
41
|
|
|
@@ -35,11 +53,17 @@ RSpec::Matchers.define(:match_list) do |actual|
|
|
|
35
53
|
end
|
|
36
54
|
|
|
37
55
|
failure_message_for_should do |container|
|
|
38
|
-
|
|
56
|
+
puts "\n"
|
|
57
|
+
print_diff(@diff)
|
|
58
|
+
puts "\n"
|
|
59
|
+
""
|
|
39
60
|
end
|
|
40
61
|
|
|
41
62
|
failure_message_for_should_not do |container|
|
|
42
|
-
|
|
63
|
+
puts "\n"
|
|
64
|
+
print_diff(@diff)
|
|
65
|
+
puts "\n"
|
|
66
|
+
""
|
|
43
67
|
end
|
|
44
68
|
|
|
45
69
|
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.4.
|
|
5
|
+
version: 1.4.2
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
8
8
|
- Dan Langevin
|
|
@@ -153,7 +153,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
153
153
|
requirements:
|
|
154
154
|
- - ">="
|
|
155
155
|
- !ruby/object:Gem::Version
|
|
156
|
-
hash:
|
|
156
|
+
hash: 1097571649744545585
|
|
157
157
|
segments:
|
|
158
158
|
- 0
|
|
159
159
|
version: "0"
|