1
0
Fork 0
mirror of https://github.com/thoughtbot/capybara-webkit synced 2023-03-27 23:22:28 -04:00
capybara-webkit/spec/spec_helper.rb
Hongli Lai (Phusion) dc49e5f875 Forward webkit_server's stdout to Ruby's stdout.
This allows console.log() messages to be visible, and prevents
large numbers of console.log() calls from filling up webkit_server's pipe
which would block the process.
2011-08-15 19:04:40 +02:00

25 lines
746 B
Ruby

require 'rspec'
require 'rspec/autorun'
PROJECT_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..')).freeze
$LOAD_PATH << File.join(PROJECT_ROOT, 'lib')
Dir[File.join(PROJECT_ROOT, 'spec', 'support', '**', '*.rb')].each { |file| require(file) }
spec_dir = nil
$:.detect do |dir|
if File.exists? File.join(dir, "capybara.rb")
spec_dir = File.expand_path(File.join(dir,"..","spec"))
$:.unshift( spec_dir )
end
end
require File.join(spec_dir,"spec_helper")
require 'capybara/driver/webkit/browser'
$webkit_browser = Capybara::Driver::Webkit::Browser.new(:socket_class => TCPSocket, :stdout => nil)
Capybara.register_driver :reusable_webkit do |app|
Capybara::Driver::Webkit.new(app, :browser => $webkit_browser)
end