mute 1.0.0 → 1.1.0

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: 9fbad050d8943b84c90dcba8296406c41ca1809e
4
- data.tar.gz: bfcdd12c57f38d6a2e90eec60fa5a8b15292bd74
3
+ metadata.gz: 364116d4a16c989393501ed20235037a0baa5500
4
+ data.tar.gz: 5424d01051348a08be6987a4a22111226bd31529
5
5
  SHA512:
6
- metadata.gz: cdb324d79d6d71ffb34e2ab0f8b9ed512c0b6447ac7755ca1575944e9dff09abfb09f59fec32356adb155e366576fdede4ac115cf925cc3b8aef0e9d6fe2d343
7
- data.tar.gz: 6e3a5625524e2a1b7d5ad0b7c5cfd97eb6769a3d1ce1597235a8e88c00ec3dbe7cecf798c4e7e97d592ac9a023806a33a1f3813556c776ff8e9be20a381ecc09
6
+ metadata.gz: 7c54a9963fec6dbf456a9b743ae120b611a5516cdf1e6b0b6922cd2c75bb3efc6a925c342b947512b499fb59cf1b237ce2eea1c0ce693aa6f6eda224a28f2353
7
+ data.tar.gz: 6e97bb82faa9a232d4939cf18c6f948f568eaf3c7eaeba14b5eaf3b381dcefa9169d3c88f4f5e5decf16a1efb719a6921cd56c8f78d26008564736062cb4be02
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ##v1.1.0
4
+ *2014-01-19*
5
+
6
+ - [#1](https://github.com/chrishunt/mute/pull/1) Always mute when no block is provided
7
+
3
8
  ##v1.0.0
4
9
  *2014-01-19*
5
10
 
data/README.md CHANGED
@@ -42,7 +42,7 @@ puts output
42
42
  #=> Oops!
43
43
  ```
44
44
 
45
- Or use it in your test suite:
45
+ Use it in your test suite to verify output:
46
46
 
47
47
  ```ruby
48
48
  require 'mute'
@@ -60,6 +60,15 @@ describe MyLogger do
60
60
  end
61
61
  ```
62
62
 
63
+ Or just mute stdout completely for the whole test suite:
64
+
65
+ ```ruby
66
+ # spec/spec_helper.rb
67
+ require 'mute'
68
+
69
+ Mute::IO.capture_stdout
70
+ ```
71
+
63
72
  ## Installation
64
73
 
65
74
  ```bash
@@ -20,7 +20,7 @@ module Mute
20
20
 
21
21
  captured.string
22
22
  ensure
23
- eval "$#{stream} = original"
23
+ eval "$#{stream} = original" if block
24
24
  end
25
25
  end
26
26
  end
@@ -1,3 +1,3 @@
1
1
  module Mute
2
- VERSION = '1.0.0'
2
+ VERSION = '1.1.0'
3
3
  end
@@ -43,8 +43,12 @@ describe Mute::IO do
43
43
  expect($stdout).to eq original
44
44
  end
45
45
 
46
- it 'does not require a block' do
47
- expect { described_class.capture_stdout }.to_not raise_error
46
+ it 'captures stdout indefinitely when called without a block' do
47
+ expect($stdout).to_not receive(:puts)
48
+
49
+ described_class.capture_stdout
50
+
51
+ puts 'hello'
48
52
  end
49
53
  end
50
54
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mute
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Hunt