Skip to content

Commit

Permalink
Merge pull request ci-reporter#15 from necolt/master
Browse files Browse the repository at this point in the history
Fixed failures dump
  • Loading branch information
nicksieger committed Aug 29, 2011
2 parents dc3c2bb + eca73f1 commit 545ddea
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions ci_reporter.gemspec
Expand Up @@ -9,8 +9,8 @@ Gem::Specification.new do |s|
s.date = %q{2011-06-14}
s.description = %q{CI::Reporter is an add-on to Test::Unit, RSpec and Cucumber that allows you to generate XML reports of your test, spec and/or feature runs. The resulting files can be read by a continuous integration system that understands Ant's JUnit report XML format, thus allowing your CI system to track test/spec successes and failures.}
s.email = %q{nick@nicksieger.com}
s.extra_rdoc_files = ["History.txt", "Manifest.txt", "README.txt", "LICENSE.txt"]
s.files = ["History.txt", "Manifest.txt", "README.txt", "LICENSE.txt", "Rakefile", "stub.rake", "lib/ci/reporter/core.rb", "lib/ci/reporter/cucumber.rb", "lib/ci/reporter/report_manager.rb", "lib/ci/reporter/rspec.rb", "lib/ci/reporter/test_suite.rb", "lib/ci/reporter/test_unit.rb", "lib/ci/reporter/version.rb", "lib/ci/reporter/rake/cucumber.rb", "lib/ci/reporter/rake/cucumber_loader.rb", "lib/ci/reporter/rake/rspec.rb", "lib/ci/reporter/rake/rspec_loader.rb", "lib/ci/reporter/rake/test_unit.rb", "lib/ci/reporter/rake/test_unit_loader.rb", "lib/ci/reporter/rake/utils.rb", "spec/spec_helper.rb", "spec/ci/reporter/cucumber_spec.rb", "spec/ci/reporter/output_capture_spec.rb", "spec/ci/reporter/report_manager_spec.rb", "spec/ci/reporter/rspec_spec.rb", "spec/ci/reporter/test_suite_spec.rb", "spec/ci/reporter/test_unit_spec.rb", "spec/ci/reporter/rake/rake_tasks_spec.rb", "tasks/ci_reporter.rake"]
s.extra_rdoc_files = ["History.txt", "README.txt", "LICENSE.txt"]
s.files = ["History.txt", "README.txt", "LICENSE.txt", "Rakefile", "stub.rake", "lib/ci/reporter/core.rb", "lib/ci/reporter/cucumber.rb", "lib/ci/reporter/report_manager.rb", "lib/ci/reporter/rspec.rb", "lib/ci/reporter/test_suite.rb", "lib/ci/reporter/test_unit.rb", "lib/ci/reporter/version.rb", "lib/ci/reporter/rake/cucumber.rb", "lib/ci/reporter/rake/cucumber_loader.rb", "lib/ci/reporter/rake/rspec.rb", "lib/ci/reporter/rake/rspec_loader.rb", "lib/ci/reporter/rake/test_unit.rb", "lib/ci/reporter/rake/test_unit_loader.rb", "spec/spec_helper.rb", "spec/ci/reporter/cucumber_spec.rb", "spec/ci/reporter/output_capture_spec.rb", "spec/ci/reporter/report_manager_spec.rb", "spec/ci/reporter/rspec_spec.rb", "spec/ci/reporter/test_suite_spec.rb", "spec/ci/reporter/test_unit_spec.rb", "spec/ci/reporter/rake/rake_tasks_spec.rb", "tasks/ci_reporter.rake"]
s.homepage = %q{http://caldersphere.rubyforge.org/ci_reporter}
s.rdoc_options = ["--main", "README.txt", "-SHN", "-f", "darkfish"]
s.require_paths = ["lib"]
Expand Down
7 changes: 4 additions & 3 deletions lib/ci/reporter/rspec.rb
Expand Up @@ -43,9 +43,9 @@ def error?
!failure?
end

def name() exception.class.name end
def message() exception.message end
def location() (exception.backtrace || ["No backtrace available"]).join("\n") end
def name() @example.metadata[:execution_result][:exception].class.name end
def message() @example.metadata[:execution_result][:exception].message end
def location() @example.metadata[:execution_result][:exception].backtrace.join("\n") end
end

class RSpec2Failure < RSpecFailure
Expand Down Expand Up @@ -164,6 +164,7 @@ def dump_failure(*args)
def dump_summary(*args)
@formatter.dump_summary(*args)
write_report
@formatter.dump_failures
end

def dump_pending
Expand Down
4 changes: 4 additions & 0 deletions spec/ci/reporter/rspec_spec.rb
Expand Up @@ -53,6 +53,7 @@
@formatter.should_receive(:dump_failure).once
@formatter.should_receive(:dump_summary).once
@formatter.should_receive(:dump_pending).once
@formatter.should_receive(:dump_failures).once
@formatter.should_receive(:close).once

@fmt.start(3)
Expand All @@ -76,6 +77,7 @@
@formatter.should_receive(:example_started).once
@formatter.should_receive(:example_passed).once
@formatter.should_receive(:dump_summary)
@formatter.should_receive(:dump_failures).once
@report_mgr.should_receive(:write_report)

@fmt.start(2)
Expand All @@ -96,6 +98,7 @@
@formatter.should_receive(:example_started).with(example).once
@formatter.should_receive(:example_passed).once
@formatter.should_receive(:dump_summary)
@formatter.should_receive(:dump_failures).once
@report_mgr.should_receive(:write_report).and_return do |suite|
suite.testcases.last.name.should == "should do something"
end
Expand All @@ -116,6 +119,7 @@
@formatter.should_receive(:example_started).once
@formatter.should_receive(:example_failed).once
@formatter.should_receive(:dump_summary)
@formatter.should_receive(:dump_failures).once
@report_mgr.should_receive(:write_report)

@fmt.start(2)
Expand Down

0 comments on commit 545ddea

Please sign in to comment.