Class: Browser
- Inherits:
-
Object
show all
- Defined in:
- lib/test/browser.rb,
lib/distil/browser.rb
Instance Method Summary
collapse
Instance Method Details
#applescript(script) ⇒ Object
24
25
26
27
|
# File 'lib/test/browser.rb', line 24
def applescript(script)
raise "Can't run AppleScript on #{host}" unless macos?
system "osascript -e '#{script}' 2>&1 >/dev/null"
end
|
#host ⇒ Object
7
8
9
10
|
# File 'lib/test/browser.rb', line 7
def host
require 'rbconfig'
Config::CONFIG['host']
end
|
#linux? ⇒ Boolean
20
21
22
|
# File 'lib/test/browser.rb', line 20
def linux?
host.include?('linux')
end
|
#macos? ⇒ Boolean
12
13
14
|
# File 'lib/test/browser.rb', line 12
def macos?
host.include?('darwin')
end
|
#open(url) ⇒ Object
4
|
# File 'lib/test/browser.rb', line 4
def open(url) ; end
|
#setup ⇒ Object
3
|
# File 'lib/test/browser.rb', line 3
def setup ; end
|
#supported? ⇒ Boolean
2
|
# File 'lib/test/browser.rb', line 2
def supported?; true; end
|
#teardown ⇒ Object
5
|
# File 'lib/test/browser.rb', line 5
def teardown ; end
|
#windows? ⇒ Boolean
16
17
18
|
# File 'lib/test/browser.rb', line 16
def windows?
host.include?('mswin')
end
|