Sha256: 71e6dc0f984c36383b5035c21ed2065041841d86e5754801ff709cf39e177147
Contents?: true
Size: 1.04 KB
Versions: 7
Compression:
Stored size: 1.04 KB
Contents
module WatirSplash module Page class Base include SpecHelper class << self @@url = "about:blank" def url url @@url = url end end def initialize(browser=nil) if browser @browser = WatirSplash::Browser.current = browser else @browser = WatirSplash::Browser.new @browser.goto @@url end end def modify element, methodz methodz.each_pair do |meth, return_value| element.instance_eval do instance_variable_set("@_#{meth}_return_value_proc", return_value) instance_eval %Q[ self.class.send(:alias_method, :__#{meth}, :#{meth}) if respond_to? :#{meth} def #{meth}(*args) self.send(:__#{meth}, *args) if respond_to? :__#{meth} instance_variable_get("@_#{meth}_return_value_proc").call(*args) end ] end end element end end end end
Version data entries
7 entries across 7 versions & 1 rubygems