Permalink
Browse files

Fix rspec2 specs

  • Loading branch information...
1 parent 867a5b3 commit d52f7f07de5423f877b4f36e26eee0683306b790 @nicksieger nicksieger committed Jun 14, 2011
Showing with 6 additions and 4 deletions.
  1. +6 −4 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.
@@ -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

0 comments on commit d52f7f0

Please sign in to comment.