forked from brynary/webrat
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Made Selenium Rails integration tests at least runnable, although
there are failures.
- Loading branch information
Larry Diehl
committed
May 29, 2009
1 parent
c3f067b
commit 6279137
Showing
3 changed files
with
25 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
module Webrat | ||
module Selenium | ||
module SilenceStream | ||
def silence_stream(stream) | ||
old_stream = stream.dup | ||
stream.reopen(RUBY_PLATFORM =~ /mswin/ ? 'NUL:' : '/dev/null') | ||
stream.sync = true | ||
yield | ||
ensure | ||
stream.reopen(old_stream) | ||
# active_support already defines silence_stream, no need to do that again if it's already present. | ||
# http://github.com/rails/rails/blob/master/activesupport/lib/active_support/core_ext/kernel/reporting.rb | ||
unless Kernel.respond_to?(:silence_stream) | ||
def silence_stream(stream) | ||
old_stream = stream.dup | ||
stream.reopen(RUBY_PLATFORM =~ /mswin/ ? 'NUL:' : '/dev/null') | ||
stream.sync = true | ||
yield | ||
ensure | ||
stream.reopen(old_stream) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters