Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit c03c0f2

Browse files
committed
rename error count variable
1 parent 81cdb9f commit c03c0f2

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

lib/rspec/core/notifications.rb

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -281,10 +281,12 @@ def fully_formatted
281281
# @attr pending_examples [Array<RSpec::Core::Example>] the pending examples
282282
# @attr load_time [Float] the number of seconds taken to boot RSpec
283283
# and load the spec files
284-
# @attr errors [Integer] the number of errors that have occurred processing
285-
# the spec suite
284+
# @attr errors_outside_of_examples_count [Integer] the number of errors that
285+
# have occurred processing
286+
# the spec suite
286287
SummaryNotification = Struct.new(:duration, :examples, :failed_examples,
287-
:pending_examples, :load_time, :errors)
288+
:pending_examples, :load_time,
289+
:errors_outside_of_examples_count)
288290
class SummaryNotification
289291
# @api
290292
# @return [Fixnum] the number of examples run
@@ -310,8 +312,9 @@ def totals_line
310312
summary = Formatters::Helpers.pluralize(example_count, "example")
311313
summary << ", " << Formatters::Helpers.pluralize(failure_count, "failure")
312314
summary << ", #{pending_count} pending" if pending_count > 0
313-
if errors > 0
314-
summary << ", " << Formatters::Helpers.pluralize(errors, "error")
315+
if errors_outside_of_examples_count > 0
316+
summary << ", "
317+
summary << Formatters::Helpers.pluralize(errors_outside_of_examples_count, "error")
315318
summary << " occurred outside of examples"
316319
end
317320
summary

lib/rspec/core/reporter.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def initialize(configuration)
1818
@failed_examples = []
1919
@pending_examples = []
2020
@duration = @start = @load_time = nil
21-
@errors = 0
21+
@non_example_exception_count = 0
2222
end
2323

2424
# @private
@@ -158,7 +158,7 @@ def deprecation(hash)
158158
# Exceptions will be formatted the same way they normally are.
159159
def notify_non_example_exception(exception, context_description)
160160
@configuration.world.non_example_failure = true
161-
@errors += 1
161+
@non_example_exception_count += 1
162162

163163
example = Example.new(AnonymousExampleGroup, context_description, {})
164164
presenter = Formatters::ExceptionPresenter.new(exception, example, :indentation => 0)
@@ -179,7 +179,8 @@ def finish
179179
@profiler.example_groups)
180180
end
181181
notify :dump_summary, Notifications::SummaryNotification.new(@duration, @examples, @failed_examples,
182-
@pending_examples, @load_time, @errors)
182+
@pending_examples, @load_time,
183+
@non_example_exception_count)
183184
notify :seed, Notifications::SeedNotification.new(@configuration.seed, seed_used?)
184185
end
185186
end

0 commit comments

Comments
 (0)