Module: Watir::RSpec::Helper
- Extended by:
- Forwardable
- Defined in:
- lib/watir/rspec/helper.rb
Instance Method Summary collapse
-
#browser ⇒ Watir::Browser
A current browser instance if it is initialized with.
-
#method_missing(name, *args)
Will dispatch all missing methods to the #browser instance.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args)
Will dispatch all missing methods to the #browser instance.
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/watir/rspec/helper.rb', line 20 def method_missing(name, *args) if browser.respond_to?(name) Helper.module_eval %Q[ def #{name}(*args) browser.send(:#{name}, *args) {yield} end ] self.send(name, *args) {yield} else super end end |
Instance Method Details
#browser ⇒ Watir::Browser
Returns a current browser instance if it is initialized with @browser or $browser variable name.
10 11 12 |
# File 'lib/watir/rspec/helper.rb', line 10 def browser @browser || $browser end |