Class: Teaspoon::Drivers::PhantomjsDriver
- Includes:
- Utility
- Defined in:
- lib/teaspoon/drivers/phantomjs_driver.rb
Instance Method Summary collapse
-
#initialize(options = nil) ⇒ PhantomjsDriver
constructor
A new instance of PhantomjsDriver.
- #run_specs(runner, url) ⇒ Object
Methods included from Utility
Constructor Details
#initialize(options = nil) ⇒ PhantomjsDriver
Returns a new instance of PhantomjsDriver.
12 13 14 15 16 17 18 19 20 |
# File 'lib/teaspoon/drivers/phantomjs_driver.rb', line 12 def initialize( = nil) ||= [] case when Array then @options = when String then @options = .split(" ") when Hash then @options = .map { |k, v| "--#{k}=#{v}" } else raise Teaspoon::UnknownDriverOptions, "Unknown driver options -- supply a string, array or hash" end end |
Instance Method Details
#run_specs(runner, url) ⇒ Object
22 23 24 25 26 |
# File 'lib/teaspoon/drivers/phantomjs_driver.rb', line 22 def run_specs(runner, url) run(*(url)) do |line| runner.process(line) if line && line.strip != "" end end |