Sha256: 44003cdc48886014837af7f1dfb438115a215898676ee6dbd5d28204f1232274

Contents?: true

Size: 689 Bytes

Versions: 6

Compression:

Stored size: 689 Bytes

Contents

require "phantomjs"
require "teabag/runner"

module Teabag
  module Drivers
    class PhantomjsDriver < BaseDriver

      # inject into phantomjs to override the bin path
      Phantomjs.send :extend, Module.new do
        def get_executable
          Teabag.configuration.phantomjs_bin
        end
      end if Teabag.configuration.phantomjs_bin.present?

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

        Phantomjs.run(script, url) do |line|
          runner.process(line)
        end

        runner.failure_count
      end

      protected

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
teabag-0.5.0 lib/teabag/drivers/phantomjs_driver.rb
teabag-0.4.6 lib/teabag/drivers/phantomjs_driver.rb
teabag-0.4.5 lib/teabag/drivers/phantomjs_driver.rb
teabag-0.4.4 lib/teabag/drivers/phantomjs_driver.rb
teabag-0.4.3 lib/teabag/drivers/phantomjs_driver.rb
teabag-0.4.2 lib/teabag/drivers/phantomjs_driver.rb