Sha256: 90daee560e14c77b9514231c6772a7025c1c28c7fa0718484bbda6b7cc22fd9c

Contents?: true

Size: 1.11 KB

Versions: 2

Compression:

Stored size: 1.11 KB

Contents

require 'spec_helper'

describe Konacha::Runner do
  before do
    Konacha.mode = :runner
    Konacha.config.driver = :selenium_with_firebug
  end

  let(:runner) { Konacha::Runner.new(:output => buffer) }
  let(:buffer) { StringIO.new }

  describe "#run" do
    before { runner.run }

    it "prints results to the output" do
      buffer.rewind
      results = buffer.read
      # "should include" gives us nice multi-line error messages if there is
      # more than one failure
      results.should include 'examples, 1 failure'
      # Failure output present?
      results.should include 'F'
      results.should include 'expected 4 to equal 5'
      # Enough examples run?
      results.should match /[1-9][0-9]+ examples, 1 failure/
    end
  end

  describe "#run_spec" do
    let(:spec) { Konacha::Spec.find("failing_spec").first }
    before { runner.spec_runner(spec).run }

    it "prints results to the output" do
      buffer.rewind
      results = buffer.read
      results.should include('F')
      results.should include("expected 4 to equal 5")
      results.should include("1 examples, 1 failures")
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
konacha-0.10.0 spec/runner_spec.rb
konacha-0.9.1 spec/runner_spec.rb