Sha256: bc897de1132f11eb205e290584b22cc490c3878ff379eef35fd55ebbbf5b1ddf

Contents?: true

Size: 790 Bytes

Versions: 3

Compression:

Stored size: 790 Bytes

Contents

require File.dirname(__FILE__) + '/../../spec_helper'
require 'mspec/runner/formatters/summary'
require 'mspec/runner/state'

describe SummaryFormatter, "#after" do
  before :each do
    $stdout = @out = IOStub.new
    @formatter = SummaryFormatter.new
    @state = SpecState.new("describe", "it")
  end

  after :each do
    $stdout = STDOUT
  end

  it "does not print anything" do
    MSpec.stub!(:register)
    tally = mock("tally", :null_object => true)
    tally.stub!(:failures).and_return(1)
    tally.stub!(:errors).and_return(1)
    TallyAction.stub!(:new).and_return(tally)

    @formatter.register
    @state.exceptions << ExpectationNotMetError.new("disappointing")
    @state.exceptions << Exception.new("painful")
    @formatter.after(@state)
    @out.should == ""
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mspec-1.0.0 spec/runner/formatters/summary_spec.rb
mspec-1.1.0 spec/runner/formatters/summary_spec.rb
mspec-1.1.1 spec/runner/formatters/summary_spec.rb