2009-11-16 21:02:16 +00:00
|
|
|
require 'nokogiri'
|
|
|
|
|
|
|
|
module Capybara
|
2009-12-13 14:08:12 +00:00
|
|
|
VERSION = '0.2.0'
|
2009-11-16 21:02:16 +00:00
|
|
|
|
|
|
|
class CapybaraError < StandardError; end
|
|
|
|
class DriverNotFoundError < CapybaraError; end
|
|
|
|
class ElementNotFound < CapybaraError; end
|
2009-12-12 12:33:00 +00:00
|
|
|
class NotSupportedByDriverError < CapybaraError; end
|
2009-11-16 21:02:16 +00:00
|
|
|
|
|
|
|
class << self
|
|
|
|
attr_accessor :debug, :asset_root
|
2009-12-03 17:50:03 +00:00
|
|
|
attr_writer :default_selector
|
|
|
|
|
|
|
|
def default_selector
|
|
|
|
@default_selector ||= :xpath
|
|
|
|
end
|
2009-12-12 12:33:00 +00:00
|
|
|
|
2009-11-16 21:02:16 +00:00
|
|
|
def log(message)
|
|
|
|
puts "[capybara] #{message}" if debug
|
|
|
|
true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2009-12-09 20:43:40 +00:00
|
|
|
autoload :Server, 'capybara/server'
|
2009-11-16 21:02:16 +00:00
|
|
|
autoload :Session, 'capybara/session'
|
2009-12-09 20:43:40 +00:00
|
|
|
autoload :Node, 'capybara/node'
|
|
|
|
autoload :XPath, 'capybara/xpath'
|
2009-11-16 21:02:16 +00:00
|
|
|
|
|
|
|
module Driver
|
2009-12-09 20:43:40 +00:00
|
|
|
autoload :Base, 'capybara/driver/base'
|
2009-11-16 21:02:16 +00:00
|
|
|
autoload :RackTest, 'capybara/driver/rack_test_driver'
|
|
|
|
autoload :Culerity, 'capybara/driver/culerity_driver'
|
|
|
|
autoload :Selenium, 'capybara/driver/selenium_driver'
|
|
|
|
end
|
|
|
|
end
|