1
0
Fork 0
mirror of https://github.com/thoughtbot/capybara-webkit synced 2023-03-27 23:22:28 -04:00
capybara-webkit/spec/support/output_writer.rb
Joe Ferris 3804dd5406 Introduce allowed, blocked URL filters
* Adds `allow_url`, `block_url`, and `block_unknown_url` methods.
* Both allow_url and block_url accept wildcards.
* Any requests to blocked URLs will be blocked immediately.
* Blocked URLs take precedence over allowed URLs.
* By default, any requests to localhost and 127.0.0.1 are allowed.
* By default, any requests to unknown hosts will print a warning.
* `block_unknown_urls` causes unknown hosts to be silently blocked.
* `blacklisted_urls=` is deprecated in favor of `block_url`.
2014-12-05 12:48:03 -05:00

15 lines
287 B
Ruby

shared_examples_for "output writer" do
before do
@read, @write = IO.pipe
end
let(:browser) do
connection = Capybara::Webkit::Connection.new(:stderr => @write)
Capybara::Webkit::Browser.new(connection)
end
let(:stderr) do
@write.close
@read.read
end
end