From 1e2f3f7c6683007d863211f7410cfe01dd591bf6 Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Tue, 18 May 2021 19:38:04 -0600 Subject: [PATCH] Use index offset argument --- src/spectator/formatting/summary.cr | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/spectator/formatting/summary.cr b/src/spectator/formatting/summary.cr index eca030c..f0b9279 100644 --- a/src/spectator/formatting/summary.cr +++ b/src/spectator/formatting/summary.cr @@ -23,8 +23,8 @@ module Spectator::Formatting io.puts "Pending:" io.puts - examples.each_with_index do |example, index| - io.puts Components::PendingBlock.new(example, index + 1) + examples.each_with_index(1) do |example, index| + io.puts Components::PendingBlock.new(example, index) end end @@ -36,11 +36,11 @@ module Spectator::Formatting io.puts "Failures:" io.puts - examples.each_with_index do |example, index| + examples.each_with_index(1) do |example, index| if result = example.result.as?(ErrorResult) - io.puts Components::ErrorResultBlock.new(index + 1, example, result) + io.puts Components::ErrorResultBlock.new(index, example, result) elsif result = example.result.as?(FailResult) - io.puts Components::FailResultBlock.new(index + 1, example, result) + io.puts Components::FailResultBlock.new(index, example, result) end end end