Class: FirefoxBrowser
Instance Method Summary collapse
-
#initialize(path = File.join(ENV['ProgramFiles'] || 'c:\Program Files', '\Mozilla Firefox\firefox.exe')) ⇒ FirefoxBrowser
constructor
A new instance of FirefoxBrowser.
- #to_s ⇒ Object
- #visit(url) ⇒ Object
Methods inherited from Browser
#applescript, #host, #linux?, #macos?, #open, #setup, #supported?, #teardown, #windows?
Constructor Details
#initialize(path = File.join(ENV['ProgramFiles'] || 'c:\Program Files', '\Mozilla Firefox\firefox.exe')) ⇒ FirefoxBrowser
Returns a new instance of FirefoxBrowser.
31 32 33 |
# File 'lib/test/browser.rb', line 31 def initialize(path=File.join(ENV['ProgramFiles'] || 'c:\Program Files', '\Mozilla Firefox\firefox.exe')) @path = path end |
Instance Method Details
#to_s ⇒ Object
41 42 43 |
# File 'lib/test/browser.rb', line 41 def to_s "Firefox" end |
#visit(url) ⇒ Object
35 36 37 38 39 |
# File 'lib/test/browser.rb', line 35 def visit(url) system("open -a \"Firefox.app\" '#{url}'") if macos? system("#{@path} #{url}") if windows? system("firefox #{url}") if linux? end |