Sha256: ede47a9e4a1e9f115912caea1f1fc0632ea1b1c4289024d3344aeeccaaeecf66

Contents?: true

Size: 820 Bytes

Versions: 19

Compression:

Stored size: 820 Bytes

Contents

require "spec_helper"
require "teabag/drivers/phantomjs_driver"

describe Teabag::Drivers::PhantomjsDriver do

  describe "#run_specs" do

    before do
      Phantomjs.stub(:run)
    end

    it "instantiates the formatter" do
      runner = mock(failure_count: nil)
      Teabag::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 = [Teabag::Engine.root.join("lib/teabag/drivers/phantomjs/runner.coffee").to_s, "_url_"]
      Teabag::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

19 entries across 19 versions & 1 rubygems

Version Path
teabag-0.7.3 spec/teabag/drivers/phantomjs_driver_spec.rb
teabag-0.7.2 spec/teabag/drivers/phantomjs_driver_spec.rb
teabag-0.7.1 spec/teabag/drivers/phantomjs_driver_spec.rb
teabag-0.7.0 spec/teabag/drivers/phantomjs_driver_spec.rb
teabag-0.6.0 spec/teabag/drivers/phantomjs_driver_spec.rb
teabag-0.5.5 spec/teabag/drivers/phantomjs_driver_spec.rb
teabag-0.5.4 spec/teabag/drivers/phantomjs_driver_spec.rb
teabag-0.5.3 spec/teabag/drivers/phantomjs_driver_spec.rb
teabag-0.5.2 spec/teabag/drivers/phantomjs_driver_spec.rb
teabag-0.5.1 spec/teabag/drivers/phantomjs_driver_spec.rb
teabag-0.5.0 spec/teabag/drivers/phantomjs_driver_spec.rb
teabag-0.4.6 spec/teabag/drivers/phantomjs_driver_spec.rb
teabag-0.4.5 spec/teabag/drivers/phantomjs_driver_spec.rb
teabag-0.4.4 spec/teabag/drivers/phantomjs_driver_spec.rb
teabag-0.4.3 spec/teabag/drivers/phantomjs_driver_spec.rb
teabag-0.4.2 spec/teabag/drivers/phantomjs_driver_spec.rb
teabag-0.4.1 spec/teabag/drivers/phantomjs_driver_spec.rb
teabag-0.4.0 spec/teabag/drivers/phantomjs_driver_spec.rb
teabag-0.3.6 spec/teabag/drivers/phantomjs_driver_spec.rb