Skip to content

Commit

Permalink
fix: gets rid of Metrics/MethodLength in Diff#diff
Browse files Browse the repository at this point in the history
  • Loading branch information
KarlHeitmann committed May 7, 2024
1 parent d50d742 commit 41e3c21
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/rspec/support/differ.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,9 @@ def diff(actual, expected)

unless actual.nil? || expected.nil?
if all_strings?(actual, expected)
if any_multiline_strings?(actual, expected)
diff = diff_as_string(coerce_to_string(actual), coerce_to_string(expected))
end
diff = diff_as_string(coerce_to_string(actual), coerce_to_string(expected)) if any_multiline_strings?(actual, expected)
elsif hash_with_anything?(expected)
if no_procs_no_numbers.call(actual, expected)
diff = diff_as_object_with_anything(actual, expected)
end
diff = diff_as_object_with_anything(actual, expected) if no_procs_no_numbers.call(actual, expected)
elsif no_procs_no_numbers.call(actual, expected)
diff = diff_as_object(actual, expected)
end
Expand Down

0 comments on commit 41e3c21

Please sign in to comment.