Skip to content

Commit

Permalink
Fix rspec2 specs
Browse files Browse the repository at this point in the history
  • Loading branch information
nicksieger committed Jun 14, 2011
1 parent 867a5b3 commit d52f7f0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions spec/ci/reporter/rspec_spec.rb
@@ -1,4 +1,4 @@
# Copyright (c) 2006-2010 Nick Sieger <nicksieger@gmail.com>
# Copyright (c) 2006-2011 Nick Sieger <nicksieger@gmail.com>
# See the file LICENSE.txt included with the distribution for
# software license details.

Expand Down Expand Up @@ -123,21 +123,23 @@
@fmt.example_failed("should fail", 1, @error)
@fmt.dump_summary(0.1, 1, 0, 0)
end

describe 'RSpec2Failure' do
before(:each) do
@formatter = mock "formatter"
@formatter.should_receive(:format_backtrace).and_return("backtrace")
@rspec20_example = mock('RSpec2.0 Example', :execution_result => {:exception_encountered => StandardError.new('rspec2.0 ftw')})
@rspec22_example = mock('RSpec2.2 Example', :execution_result => {:exception => StandardError.new('rspec2.2 ftw')})
end

it 'should handle rspec (< 2.2) execution results' do
failure = CI::Reporter::RSpec2Failure.new(@rspec20_example)
failure = CI::Reporter::RSpec2Failure.new(@rspec20_example, @formatter)
failure.name.should_not be_nil
failure.message.should == 'rspec2.0 ftw'
failure.location.should_not be_nil
end
it 'should handle rspec (>= 2.2) execution results' do
failure = CI::Reporter::RSpec2Failure.new(@rspec22_example)
failure = CI::Reporter::RSpec2Failure.new(@rspec22_example, @formatter)
failure.name.should_not be_nil
failure.message.should == 'rspec2.2 ftw'
failure.location.should_not be_nil
Expand Down

0 comments on commit d52f7f0

Please sign in to comment.