Sha256: a606982d43672ae383a3dab122d730bed5065118536b716c9620c805bc847b14

Contents?: true

Size: 834 Bytes

Versions: 4

Compression:

Stored size: 834 Bytes

Contents

require "spec_helper"
require "teaspoon/drivers/phantomjs_driver"

describe Teaspoon::Drivers::PhantomjsDriver do

  describe "#run_specs" do

    before do
      Phantomjs.stub(:run)
    end

    it "instantiates the formatter" do
      runner = double(failure_count: nil)
      Teaspoon::Runner.should_receive(:new).and_return(runner)
      subject.run_specs(:default, "_url_")
    end

    it "calls phantomjs.run and logs the results of each line using the formatter" do
      args = [Teaspoon::Engine.root.join("lib/teaspoon/drivers/phantomjs/runner.coffee").to_s, "_url_"]
      Teaspoon::Runner.any_instance.should_receive(:process).with("_line_")
      @block = nil
      Phantomjs.should_receive(:run).with(*args) { |&b| @block = b }
      subject.run_specs(:default, "_url_")
      @block.call("_line_")
    end

  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
teaspoon-0.7.8 spec/teaspoon/drivers/phantomjs_driver_spec.rb
teaspoon-0.7.7 spec/teaspoon/drivers/phantomjs_driver_spec.rb
teaspoon-0.7.6 spec/teaspoon/drivers/phantomjs_driver_spec.rb
teaspoon-0.7.5 spec/teaspoon/drivers/phantomjs_driver_spec.rb