Sha256: 78c6975f10e6430591aff26329491b5160f158a2be5323c5ffae4bd9bdac5a91

Contents?: true

Size: 1.11 KB

Versions: 63

Compression:

Stored size: 1.11 KB

Contents

require File.dirname(__FILE__) + '/../../../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(ExampleGroup).describe("A")
          example_group_2 = Class.new(example_group_1).describe("B")

          @formatter.add_example_group(example_group_1)
          @formatter.example_failed(example_group_1.it("a1"){}, nil, Reporter::Failure.new(nil, RuntimeError.new))
          @formatter.add_example_group(example_group_2)
          @formatter.example_failed(example_group_2.it("b2"){}, nil, Reporter::Failure.new(nil, RuntimeError.new))
          @formatter.example_failed(example_group_2.it("b3"){}, nil, Reporter::Failure.new(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

63 entries across 63 versions & 10 rubygems

Version Path
dchelimsky-rspec-1.1.10 spec/spec/runner/formatter/failing_examples_formatter_spec.rb
dchelimsky-rspec-1.1.11.1 spec/spec/runner/formatter/failing_examples_formatter_spec.rb
dchelimsky-rspec-1.1.11.2 spec/spec/runner/formatter/failing_examples_formatter_spec.rb
dchelimsky-rspec-1.1.11.3 spec/spec/runner/formatter/failing_examples_formatter_spec.rb
dchelimsky-rspec-1.1.11.4 spec/spec/runner/formatter/failing_examples_formatter_spec.rb
dchelimsky-rspec-1.1.11 spec/spec/runner/formatter/failing_examples_formatter_spec.rb
jnstq-acts_as_sms-0.1.0 test/vendor/plugins/rspec/spec/spec/runner/formatter/failing_examples_formatter_spec.rb
jnstq-acts_as_sms-0.1.1 test/vendor/plugins/rspec/spec/spec/runner/formatter/failing_examples_formatter_spec.rb
jnstq-acts_as_sms-0.1.3 test/vendor/plugins/rspec/spec/spec/runner/formatter/failing_examples_formatter_spec.rb
jnstq-acts_as_sms-0.1.4 test/vendor/plugins/rspec/spec/spec/runner/formatter/failing_examples_formatter_spec.rb
merb-core-1.1.3 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/spec/spec/runner/formatter/failing_examples_formatter_spec.rb
merb-core-1.1.2 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/spec/spec/runner/formatter/failing_examples_formatter_spec.rb
merb-core-1.1.1 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/spec/spec/runner/formatter/failing_examples_formatter_spec.rb
merb-core-1.1.0 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/spec/spec/runner/formatter/failing_examples_formatter_spec.rb
merb-core-1.1.0.rc1 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/spec/spec/runner/formatter/failing_examples_formatter_spec.rb
merb-core-1.1.0.pre spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/spec/spec/runner/formatter/failing_examples_formatter_spec.rb
mack-0.8.2 lib/gems/rspec-1.1.11/spec/spec/runner/formatter/failing_examples_formatter_spec.rb
picolena-0.0.99 app_generators/picolena/templates/vendor/plugins/rspec/spec/spec/runner/formatter/failing_examples_formatter_spec.rb
picolena-0.1.1 rails_plugins/rspec/spec/spec/runner/formatter/failing_examples_formatter_spec.rb
picolena-0.1.0 rails_plugins/rspec/spec/spec/runner/formatter/failing_examples_formatter_spec.rb