Skip to content

Commit

Permalink
Merge remote branch 'ebeigarts/master' into ebmerge
Browse files Browse the repository at this point in the history
  • Loading branch information
nicksieger committed Mar 26, 2010
2 parents 799748f + 6e47efb commit dd6cc9e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/ci/reporter/rspec.rb
Expand Up @@ -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)
Expand Down
17 changes: 17 additions & 0 deletions spec/ci/reporter/rspec_spec.rb
Expand Up @@ -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.