rspec_approvals 0.9.1 → 0.9.2

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
  SHA256:
3
- metadata.gz: ee9d20fbefe8c582b91491fc68d138f968d2af93a2ebddadc1fbcec28cd4825b
4
- data.tar.gz: 2ef26b7fa67d9bce2136d7ccb03c3c3c02984152b366eac600c6e870f3586b31
3
+ metadata.gz: 0fb4bded8ab248d2bd2826a66f0bbac01188b92614bea48bfb0203f80f118934
4
+ data.tar.gz: cfaf0bea149ef3926d99f136f291b837756af97dda04d807ce47d55f57dc72a9
5
5
  SHA512:
6
- metadata.gz: 4e2fb14501ecfc75f57c4c81b126d4b51d4a7339a014aab4a9ddbf83c86af3839fc58f83d088f42e85cd33fc858239a67247ebe0670539364c2953988b2d2d69
7
- data.tar.gz: 11c4cd21df4ca1295cb6d1087d81c9e70e1717f2015037e21aca7214a99a77a1f989468655e6c01ad76795c822bd6935c4abbd846dce410e60e6e0c8531496fa
6
+ metadata.gz: 041c95b54d4a62f16f0de9fb0502eb482723caca78698e7d9c0d41e5ce42031acbb59ced32bf18524962044ef3baa2daf6db0e07d5802350d13d550bd3cf3d50
7
+ data.tar.gz: e77f8886c6a274455423a2ee584342a78d89a53536d75419d5965d4013d8f5166c96faadd4aec4e1980d4a0dc80c8a9cb0e1fc33d04048f62170841f911a8d26
@@ -6,35 +6,36 @@ module RSpecApprovals
6
6
  # These methods are borrowed from rspec's built in matchers
7
7
  # https://github.com/rspec/rspec-expectations/blob/add9b271ecb1d65f7da5bc8a9dd8c64d81d92303/lib/rspec/matchers/built_in/output.rb
8
8
  module Stream
9
- module Stdout
10
- def self.capture(block)
9
+ module Capture
10
+ def self.capture(stream, block)
11
11
  RSpecApprovals.stdout.truncate 0
12
12
  RSpecApprovals.stdout.rewind
13
+ RSpecApprovals.stderr.truncate 0
14
+ RSpecApprovals.stderr.rewind
13
15
 
14
- original_stream = $stdout
16
+ stdout_original_stream = $stdout
17
+ stderr_original_stream = $stderr
15
18
  $stdout = RSpecApprovals.stdout
19
+ $stderr = RSpecApprovals.stderr
16
20
  block.call
17
- RSpecApprovals.stdout.string.dup
21
+ RSpecApprovals.send(stream).string.dup
18
22
 
19
23
  ensure
20
- $stdout = original_stream
24
+ $stdout = stdout_original_stream
25
+ $stderr = stderr_original_stream
21
26
 
22
27
  end
23
28
  end
24
29
 
25
- module Stderr
30
+ module Stdout
26
31
  def self.capture(block)
27
- RSpecApprovals.stderr.truncate 0
28
- RSpecApprovals.stderr.rewind
29
-
30
- original_stream = $stderr
31
- $stderr = RSpecApprovals.stderr
32
- block.call
33
- RSpecApprovals.stderr.string.dup
34
-
35
- ensure
36
- $stderr = original_stream
32
+ Capture.capture :stdout, block
33
+ end
34
+ end
37
35
 
36
+ module Stderr
37
+ def self.capture(block)
38
+ Capture.capture :stderr, block
38
39
  end
39
40
  end
40
41
  end
@@ -1,3 +1,3 @@
1
1
  module RSpecApprovals
2
- VERSION = "0.9.1"
2
+ VERSION = "0.9.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec_approvals
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danny Ben Shitrit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-25 00:00:00.000000000 Z
11
+ date: 2021-09-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colsole
@@ -105,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
105
105
  - !ruby/object:Gem::Version
106
106
  version: '0'
107
107
  requirements: []
108
- rubygems_version: 3.1.4
108
+ rubygems_version: 3.2.25
109
109
  signing_key:
110
110
  specification_version: 4
111
111
  summary: Interactive RSpec Approvals