Skip to content
Browse files

Merge remote branch 'ebeigarts/master' into ebmerge

  • Loading branch information...
2 parents 799748f + 6e47efb commit dd6cc9ee01eb442fac95b6d9c8384401d79cd7e9 @nicksieger nicksieger committed Mar 26, 2010
Showing with 21 additions and 0 deletions.
  1. +4 −0 lib/ci/reporter/rspec.rb
  2. +17 −0 spec/ci/reporter/rspec_spec.rb
View
4 lib/ci/reporter/rspec.rb
@@ -81,6 +81,10 @@ def example_started(name)
def example_failed(name, counter, failure)
@formatter.example_failed(name, counter, failure)
+ # In case we fail in before(:all)
+ if @suite.testcases.empty?
+ example_started(name)
+ end
spec = @suite.testcases.last
spec.finish
spec.failures << RSpecFailure.new(failure)
View
17 spec/ci/reporter/rspec_spec.rb
@@ -105,4 +105,21 @@
@fmt.example_passed(example)
@fmt.dump_summary(0.1, 1, 0, 0)
end
+
+ it "should create a test suite with failure in before(:all)" do
+ example_group = mock "example group"
+ example_group.stub!(:description).and_return "A context"
+
+ @formatter.should_receive(:start)
+ @formatter.should_receive(:example_group_started).with(example_group)
+ @formatter.should_receive(:example_started).once
+ @formatter.should_receive(:example_failed).once
+ @formatter.should_receive(:dump_summary)
+ @report_mgr.should_receive(:write_report)
+
+ @fmt.start(2)
+ @fmt.example_group_started(example_group)
+ @fmt.example_failed("should fail", 1, @error)
+ @fmt.dump_summary(0.1, 1, 0, 0)
+ end
end

0 comments on commit dd6cc9e

Please sign in to comment.
Something went wrong with that request. Please try again.