|
6 | 6 |
|
7 | 7 | describe Subprocess do |
8 | 8 | describe "communicate with empty string input" do |
9 | | - # Bug report: subprocess.communicate("") doesn't properly |
10 | | - # close stdin, causing you to end up a broken pipe. |
| 9 | + # Bug report: subprocess.communicate("") doesn't properly handle stdin, |
| 10 | + # causing it to close incorrectly and result in a broken pipe. |
11 | 11 | it "should not raise IOError when passing empty string" do |
12 | 12 | # Before the fix, this would raise: IOError: closed stream |
13 | | - Subprocess.check_call(['cat'], |
| 13 | + Subprocess.check_call(['cat'], |
14 | 14 | stdin: Subprocess::PIPE, |
15 | 15 | stdout: Subprocess::PIPE) do |p| |
16 | 16 | stdout, stderr = p.communicate("") |
|
21 | 21 |
|
22 | 22 | it "should work correctly with non-empty string input" do |
23 | 23 | test_input = "hello world" |
24 | | - Subprocess.check_call(['cat'], |
| 24 | + Subprocess.check_call(['cat'], |
25 | 25 | stdin: Subprocess::PIPE, |
26 | 26 | stdout: Subprocess::PIPE) do |p| |
27 | 27 | stdout, stderr = p.communicate(test_input) |
|
31 | 31 | end |
32 | 32 |
|
33 | 33 | it "should work correctly with nil input" do |
34 | | - Subprocess.check_call(['cat'], |
| 34 | + Subprocess.check_call(['cat'], |
35 | 35 | stdin: Subprocess::PIPE, |
36 | 36 | stdout: Subprocess::PIPE) do |p| |
37 | 37 | stdout, stderr = p.communicate(nil) |
|
0 commit comments