Sha256: 2643a7211ef1e84737a4dcf8e09c4669b48b773072951636d93da6e590a47790

Contents?: true

Size: 912 Bytes

Versions: 5

Compression:

Stored size: 912 Bytes

Contents

require "spec_helper"

module RSpec::Core::Formatters
  describe DocumentationFormatter do
    it "numbers the failures" do

      examples = [
        double("example 1",
               :description => "first example",
               :execution_result => {:status => 'failed', :exception_encountered => Exception.new }
              ),
        double("example 2",
               :description => "second example",
               :execution_result => {:status => 'failed', :exception_encountered => Exception.new }
              )
      ]

      output = StringIO.new
      RSpec.configuration.stub(:color_enabled?) { false }

      formatter = RSpec::Core::Formatters::DocumentationFormatter.new(output)
      
      examples.each {|e| formatter.example_finished(e) }

      output.string.should =~ /first example \(FAILED - 1\)/m
      output.string.should =~ /second example \(FAILED - 2\)/m
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rspec-core-2.0.0.beta.14 spec/rspec/core/formatters/documentation_formatter_spec.rb
rspec-core-2.0.0.beta.13 spec/rspec/core/formatters/documentation_formatter_spec.rb
rspec-core-2.0.0.beta.12 spec/rspec/core/formatters/documentation_formatter_spec.rb
rspec-core-2.0.0.beta.11 spec/rspec/core/formatters/documentation_formatter_spec.rb
rspec-core-2.0.0.beta.10 spec/rspec/core/formatters/documentation_formatter_spec.rb