Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Added support to read outside error count returned from XML formatter. #86

Merged
merged 3 commits into from
Apr 2, 2020

Conversation

pingfr
Copy link
Contributor

@pingfr pingfr commented Mar 30, 2020

I opened a issue #85 to get error count from errors outside of an example. This is the pull request for that issue. Please let me know if there is any further action needed.

@@ -45,6 +45,10 @@ def examples
@examples_notification.notifications
end

def error_count
reports_errors_outside? ? @summary_notification.errors_outside_of_examples_count : 0
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about:

Suggested change
reports_errors_outside? ? @summary_notification.errors_outside_of_examples_count : 0
# Introduced in rspec 3.6
if @summary_notification.respond_to?(:errors_outside_of_examples_count)
@summary_notification.errors_outside_of_examples_count
else
0
end

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That works for me. I will make that change and push it.

@sj26
Copy link
Owner

sj26 commented Mar 31, 2020

I think you'll need to add an errors_count method within lib/rspec_junit_formatter/rspec2.rb to fix the cross version tests.

They can be run with:

bundle install
bundle exec appraisal install
bundle exec appraisal rspec

You can test just rspec 2.x with:

bundle exec appraisal rspec-2-x rspec

@pingfr
Copy link
Contributor Author

pingfr commented Mar 31, 2020

Travis is happy now. Let me know if there are any other concerns before you accept the PR. Also wondering when it will be part of an official release.

Copy link
Owner

@sj26 sj26 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thank you!

@sj26 sj26 merged commit 35bcf25 into sj26:master Apr 2, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants