Skip to content

Commit 2729bdf

Browse files
coorassesferik
authored andcommitted
Adjustments from code review
1 parent c1a7e44 commit 2729bdf

3 files changed

Lines changed: 4 additions & 17 deletions

File tree

spec/fixtures/issue_1057.erb

Lines changed: 0 additions & 3 deletions
This file was deleted.

spec/helper.rb

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,3 @@ def source_fixture(filename)
1616
def source_fixture_base_directory
1717
@source_fixture_base_directory ||= File.dirname(__FILE__)
1818
end
19-
20-
# Taken from http://stackoverflow.com/questions/4459330/how-do-i-temporarily-redirect-stderr-in-ruby
21-
def capture_stderr
22-
# The output stream must be an IO-like object. In this case we capture it in
23-
# an in-memory IO object so we can return the string value. You can assign any
24-
# IO object here.
25-
previous_stderr = $stderr
26-
$stderr = StringIO.new
27-
yield
28-
$stderr.string
29-
ensure
30-
# Restore the previous value of stderr (typically equal to STDERR).
31-
$stderr = previous_stderr
32-
end

spec/source_file_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,10 @@
364364
it "has 16 source lines regardless of extra data in coverage array" do
365365
expect(subject.lines.count).to eq(16)
366366
end
367+
368+
it "does not output to stderr" do
369+
expect { subject.lines }.not_to output.to_stderr
370+
end
367371
end
368372

369373
context "A file that has inline branches" do

0 commit comments

Comments
 (0)