2010-07-09 20:20:32 -04:00
|
|
|
require 'capybara/node/finders'
|
|
|
|
require 'capybara/node/actions'
|
|
|
|
require 'capybara/node/matchers'
|
|
|
|
|
2010-07-09 19:19:09 -04:00
|
|
|
module Capybara
|
2010-07-09 19:38:57 -04:00
|
|
|
class Node
|
2010-07-09 19:58:34 -04:00
|
|
|
attr_reader :session, :base
|
|
|
|
|
2010-07-09 20:20:32 -04:00
|
|
|
include Capybara::Node::Finders
|
|
|
|
include Capybara::Node::Actions
|
|
|
|
include Capybara::Node::Matchers
|
|
|
|
|
2010-07-09 19:58:34 -04:00
|
|
|
def initialize(session, base)
|
|
|
|
@session = session
|
|
|
|
@base = base
|
|
|
|
end
|
2010-07-09 19:19:09 -04:00
|
|
|
|
2010-07-09 19:38:57 -04:00
|
|
|
protected
|
|
|
|
|
|
|
|
def driver
|
2010-07-09 19:49:32 -04:00
|
|
|
session.driver
|
2010-07-09 19:38:57 -04:00
|
|
|
end
|
2010-07-09 19:19:09 -04:00
|
|
|
end
|
2010-07-09 21:07:31 -04:00
|
|
|
|
|
|
|
class Element < Node
|
|
|
|
# TODO: maybe we should explicitely delegate?
|
|
|
|
def method_missing(*args)
|
|
|
|
@base.send(*args)
|
|
|
|
end
|
|
|
|
|
|
|
|
def respond_to?(method)
|
|
|
|
super || @base.respond_to?(method)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
class Document < Node
|
|
|
|
end
|
2010-07-09 19:19:09 -04:00
|
|
|
end
|