Sha256: 9d5215f08d0cd1e03504c1d506e7ca18689e469bbba5ef751ccb12a38b7016d3

Contents?: true

Size: 823 Bytes

Versions: 3

Compression:

Stored size: 823 Bytes

Contents

require 'spec_helper'

describe "Mocha Regression involving double reporting of errors" do
  
  it "should not double report mocha errors" do
    # The below example should have one error, not two
    # I'm also not sure how to test this regression without having the failure counting by 
    # the running Rspec::Core instance
    formatter = Rspec::Core::Formatters::BaseFormatter.new

    use_formatter(formatter) do

      disconnect_from_world do
        group = Rspec::Core::ExampleGroup.describe("my favorite pony") do
          example("showing a double fail") do
            foo = "string"
            foo.expects(:something)
          end
        end      
        group.examples_to_run.replace(group.examples)
        group.run(formatter)
      end

    end

    formatter.examples.size.should == 1  
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rspec-core-2.0.0.a5 spec/rspec/core/mocha_spec.rb
rspec-core-2.0.0.a4 spec/rspec/core/mocha_spec.rb
rspec-core-2.0.0.a3 spec/rspec/core/mocha_spec.rb