rspec-enriched_json 0.8.2 → 0.8.3

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
  SHA256:
3
- metadata.gz: 394af05d97929e94bd1c9b39aead58ab1254b7208f2f6be5c4dc07cb761d6d3a
4
- data.tar.gz: c23222189bcb9497bf8201847968136ec9a5323e1db191b0d4548e261688b7b2
3
+ metadata.gz: c700c8a03f06c9e945d86e625b0a29cfd39ce215a326a18fed611e443ccd50e9
4
+ data.tar.gz: dc7c2738ce6d1902255fc5a00eb9da3273a34fde6745ad6a69b4af794d039749
5
5
  SHA512:
6
- metadata.gz: ca7f20e71192f8dae52d73544b7971ccafacc425c30aa4c98ca33cc45e9d0c8723d8e0b7480aff717da4a6c8dc106229957f0d97968117593faacc2f8812ea06
7
- data.tar.gz: d90481ce505fd5badf38037ef7610d1215a5959472460f0a43d2f1d9ad027c158c51fc14f0d34f4cc1a291eabc583f09654706cc4b73f088e11a0f59be0ad73f
6
+ metadata.gz: cacd96159f205ee5e466826e30e5a2adbc41fd9581c5923071dc3f7b61111d2871d02bd266e913a80d0dae48abe722ad41091334cc2a53aee9541b7f2fac264e
7
+ data.tar.gz: 3a4991400bcf49ddc8562eaf386b1429f4dece672002d0060f7440a926347ea3c9cc4f63037d42db6b4db131d8a60e6f8da18ccb55b6aaf238d2793a3d446ce1
@@ -4,6 +4,7 @@ require "json"
4
4
  require "oj"
5
5
  require "rspec/expectations"
6
6
  require "rspec/support/differ"
7
+ require "stringio"
7
8
 
8
9
  module RSpec
9
10
  module EnrichedJson
@@ -46,7 +47,15 @@ module RSpec
46
47
  if value.is_a?(Regexp)
47
48
  return Oj.dump(value.inspect, mode: :compat)
48
49
  elsif value.is_a?(Proc)
49
- return value.call
50
+ original_stdout = $stdout
51
+ $stdout = StringIO.new
52
+
53
+ value.call
54
+
55
+ output = $stdout.string
56
+ $stdout = original_stdout
57
+
58
+ return output
50
59
  end
51
60
 
52
61
  Oj.dump(value, OJ_OPTIONS)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RSpec
4
4
  module EnrichedJson
5
- VERSION = "0.8.2"
5
+ VERSION = "0.8.3"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-enriched_json
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Raghu Betina