Permalink
Browse files

Don't forward stderr to nil

Fixes #455.
  • Loading branch information...
1 parent ea06a1b commit 9bb7b93be343dc9acdd6d28eb3ecc678c3458d14 @mhoran mhoran committed Feb 2, 2013
Showing with 7 additions and 1 deletion.
  1. +1 −1 lib/capybara/webkit/connection.rb
  2. +6 −0 spec/connection_spec.rb
View
2 lib/capybara/webkit/connection.rb
@@ -75,7 +75,7 @@ def discover_port
def forward_output_in_background_thread
Thread.new do
Thread.current.abort_on_exception = true
- IO.copy_stream(@pipe_stderr, @output_target)
+ IO.copy_stream(@pipe_stderr, @output_target) if @output_target
end
end
View
6 spec/connection_spec.rb
@@ -32,6 +32,12 @@
io.string.should =~ /hello world $/
end
+ it 'does not forward stderr to nil' do
+ IO.should_not_receive(:copy_stream)
+ Capybara::Webkit::Connection.new(:stderr => nil)
+ end
+
+
it "returns the server port" do
connection.port.should be_between 0x400, 0xffff
end

0 comments on commit 9bb7b93

Please sign in to comment.