Sha256: 9d9ce972ebba6888fd05c183440c3fa737a24b2ed89af10e0a515240d7b366fc

Contents?: true

Size: 638 Bytes

Versions: 4

Compression:

Stored size: 638 Bytes

Contents

require "phantomjs"
require "teabag/runner"
require 'teabag/utility'

module Teabag
  module Drivers
    class PhantomjsDriver < BaseDriver
      include Teabag::Utility

      def run_specs(suite, url)
        runner = Teabag::Runner.new(suite)

        Phantomjs.instance_variable_set(:@path, executable)
        Phantomjs.run(script, url) do |line|
          runner.process(line)
        end

        runner.failure_count
      end

      protected

      def executable
        @executable ||= which('phantomjs')
      end

      def script
        File.expand_path("../phantomjs/runner.coffee", __FILE__)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
teabag-0.7.3 lib/teabag/drivers/phantomjs_driver.rb
teabag-0.7.2 lib/teabag/drivers/phantomjs_driver.rb
teabag-0.7.1 lib/teabag/drivers/phantomjs_driver.rb
teabag-0.7.0 lib/teabag/drivers/phantomjs_driver.rb