Class: Teaspoon::Driver::Phantomjs
- Includes:
- Utility
- Defined in:
- lib/teaspoon/driver/phantomjs.rb
Instance Method Summary collapse
-
#initialize(options = nil) ⇒ Phantomjs
constructor
A new instance of Phantomjs.
- #run_specs(runner, url) ⇒ Object
Methods included from Utility
Constructor Details
#initialize(options = nil) ⇒ Phantomjs
Returns a new instance of Phantomjs.
16 17 18 19 20 21 22 23 24 |
# File 'lib/teaspoon/driver/phantomjs.rb', line 16 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::DriverOptionsError.new(types: "string, array or hash") end end |
Instance Method Details
#run_specs(runner, url) ⇒ Object
26 27 28 29 30 |
# File 'lib/teaspoon/driver/phantomjs.rb', line 26 def run_specs(runner, url) run(*(url)) do |line| runner.process(line) if line && line.strip != "" end end |