From 3432e30465171330a00d2a70bef2daff92bfc909 Mon Sep 17 00:00:00 2001 From: Neal Chambers Date: Fri, 21 Apr 2023 23:45:48 +0900 Subject: [PATCH] Fix Style/UnlessGuard --- spec/support/matchers/table_matchers.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/spec/support/matchers/table_matchers.rb b/spec/support/matchers/table_matchers.rb index 037a0d5d1d..09b9f694ee 100644 --- a/spec/support/matchers/table_matchers.rb +++ b/spec/support/matchers/table_matchers.rb @@ -43,10 +43,11 @@ RSpec::Matchers.define :match_table do |expected_table| elsif row != expected_row row.each_with_index do |cell, j| - if cell != expected_row[j] - @failure_message = "cell [#{i}, #{j}] has content '#{cell}', expected '#{expected_row[j]}'" - break - end + next unless cell != expected_row[j] + + @failure_message = "cell [#{i}, #{j}] has content '#{cell}', " \ + "expected '#{expected_row[j]}'" + break end break if @failure_message end