Use index offset argument

This commit is contained in:
Michael Miller 2021-05-18 19:38:04 -06:00
parent 1addc46f7e
commit 1e2f3f7c66
No known key found for this signature in database
GPG key ID: FB9F12F7C646A4AD

View file

@ -23,8 +23,8 @@ module Spectator::Formatting
io.puts "Pending:" io.puts "Pending:"
io.puts io.puts
examples.each_with_index do |example, index| examples.each_with_index(1) do |example, index|
io.puts Components::PendingBlock.new(example, index + 1) io.puts Components::PendingBlock.new(example, index)
end end
end end
@ -36,11 +36,11 @@ module Spectator::Formatting
io.puts "Failures:" io.puts "Failures:"
io.puts io.puts
examples.each_with_index do |example, index| examples.each_with_index(1) do |example, index|
if result = example.result.as?(ErrorResult) 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) 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 end
end end