Skip to content

Commit

Permalink
Updated with suggested changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
pingfr committed Mar 31, 2020
1 parent 30fae04 commit 3641d00
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/rspec_junit_formatter/rspec3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@ def examples
end

def error_count
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
end

def result_of(notification)
Expand Down Expand Up @@ -129,10 +134,6 @@ def without_color
end
end

def reports_errors_outside?
Gem::Version.new(RSpec::Core::Version::STRING) >= Gem::Version.new("3.6")
end

def stdout_for(example_notification)
example_notification.example.metadata[:stdout]
end
Expand Down

0 comments on commit 3641d00

Please sign in to comment.