Sha256: 6bf27f672de0f87f03ad9a594c578b590cb9e533fc16e41e31a933fb130cf1a3

Contents?: true

Size: 1.24 KB

Versions: 32

Compression:

Stored size: 1.24 KB

Contents

require 'spec_helper'
require 'spec/runner/formatter/failing_examples_formatter'

module Spec
  module Runner
    module Formatter
      describe FailingExamplesFormatter do
        before(:each) do
          @io = StringIO.new
          options = mock('options')
          @formatter = FailingExamplesFormatter.new(options, @io)
        end

        it "should add example name for each failure" do
          example_group_1 = Class.new(::Spec::Example::ExampleGroupDouble).describe("A")
          example_group_2 = Class.new(example_group_1).describe("B")

          @formatter.example_group_started(Spec::Example::ExampleGroupProxy.new(example_group_1))
          @formatter.example_failed(example_group_1.it("a1"){}, nil, ::Spec::Runner::Reporter::Failure.new("g", nil, RuntimeError.new))
          @formatter.example_group_started(Spec::Example::ExampleGroupProxy.new(example_group_2))
          @formatter.example_failed(example_group_2.it("b2"){}, nil, ::Spec::Runner::Reporter::Failure.new("g", nil, RuntimeError.new))
          @formatter.example_failed(example_group_2.it("b3"){}, nil, ::Spec::Runner::Reporter::Failure.new("g", nil, RuntimeError.new))
          @io.string.should eql(<<-EOF
A a1
A B b2
A B b3
EOF
)
        end
      end
    end
  end
end

Version data entries

32 entries across 32 versions & 11 rubygems

Version Path
rspec-instructure-1.3.3 spec/spec/runner/formatter/failing_examples_formatter_spec.rb
radiant-1.0.0 ruby-debug/ruby/1.8/gems/rspec-1.3.2/spec/spec/runner/formatter/failing_examples_formatter_spec.rb
rspec-1.3.2 spec/spec/runner/formatter/failing_examples_formatter_spec.rb
rspec-1.3.1 spec/spec/runner/formatter/failing_examples_formatter_spec.rb
rspec-1.3.1.rc spec/spec/runner/formatter/failing_examples_formatter_spec.rb
rspec-1.3.0 spec/spec/runner/formatter/failing_examples_formatter_spec.rb
hubbub-0.0.11 lib/vendor/plugins/rspec/spec/spec/runner/formatter/failing_examples_formatter_spec.rb
hubbub-0.0.10 lib/vendor/plugins/rspec/spec/spec/runner/formatter/failing_examples_formatter_spec.rb
hubbub-0.0.9 lib/vendor/plugins/rspec/spec/spec/runner/formatter/failing_examples_formatter_spec.rb
hubbub-0.0.8 lib/vendor/plugins/rspec/spec/spec/runner/formatter/failing_examples_formatter_spec.rb
hubbub-0.0.6 lib/vendor/plugins/rspec/spec/spec/runner/formatter/failing_examples_formatter_spec.rb
simple-templater-0.0.1.4 gems/gems/rspec-1.2.9/spec/spec/runner/formatter/failing_examples_formatter_spec.rb
media-path-0.1.2 vendor/rspec/spec/spec/runner/formatter/failing_examples_formatter_spec.rb
simple-templater-0.0.1.3 vendor/rspec/spec/spec/runner/formatter/failing_examples_formatter_spec.rb
pupu-0.0.2.pre vendor/rspec/spec/spec/runner/formatter/failing_examples_formatter_spec.rb
media-path-0.1.1.pre vendor/rspec/spec/spec/runner/formatter/failing_examples_formatter_spec.rb
simple-templater-0.0.1.2 vendor/rspec/spec/spec/runner/formatter/failing_examples_formatter_spec.rb
media-path-0.1.1 vendor/rspec/spec/spec/runner/formatter/failing_examples_formatter_spec.rb
simple-templater-0.0.1.1 vendor/rspec/spec/spec/runner/formatter/failing_examples_formatter_spec.rb
pupu-0.0.2 vendor/rspec/spec/spec/runner/formatter/failing_examples_formatter_spec.rb