Sha256: 3531b87f5d8debfc79d5e3345a6bfe2003e9c361da9f95db44bb262c6226d104

Contents?: true

Size: 662 Bytes

Versions: 5

Compression:

Stored size: 662 Bytes

Contents

module JsTestDriver
  module CLI

    class CaptureBrowsers

      attr_reader :config, :runner

      def initialize(config, runner)
        @config = config
        @runner = runner
      end

      def run(opts = {})
        browsers = opts[:browsers] || ''
        browsers = browsers.split(',')
        browsers = config.browsers if browsers.empty?

        url = config.server + "/capture?strict"

        browsers.each do |name|
          runner.runbg(browser_command(name, url))
        end
      end

      protected

      def browser_command(name, url)
        JsTestDriver::Commands::BaseCommand.new(name).arg(url).to_s
      end

    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
js-test-driver-rails-0.5.0.pre5 lib/js_test_driver/cli/capture_browsers.rb
js-test-driver-rails-0.5.0.pre4 lib/js_test_driver/cli/capture_browsers.rb
js-test-driver-rails-0.5.0.pre3 lib/js_test_driver/cli/capture_browsers.rb
js-test-driver-rails-0.5.0.pre2 lib/js_test_driver/cli/capture_browsers.rb
js-test-driver-rails-0.5.0.pre1 lib/js_test_driver/cli/capture_browsers.rb