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

Commit daa5bb5

Browse files
committed
Add code review feedback, this feat works only ruby version > 1.8.7
1 parent b993756 commit daa5bb5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/rspec/support/differ.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def diff(actual, expected)
1919
diff = diff_as_string(coerce_to_string(actual), coerce_to_string(expected))
2020
end
2121
elsif no_procs_and_no_numbers?(actual, expected)
22-
if Hash === expected && hash_with_anything?(expected)
22+
if (RUBY_VERSION.to_f > 1.8) && hash_with_anything?(expected)
2323
diff = diff_as_object_with_anything(actual, expected)
2424
else
2525
diff = diff_as_object(actual, expected)
@@ -85,7 +85,7 @@ def initialize(opts={})
8585
private
8686

8787
def hash_with_anything?(arg)
88-
safely_flatten(arg).any? { |a| RSpec::Mocks::ArgumentMatchers::AnyArgMatcher === a }
88+
Hash === arg && safely_flatten(arg).any? { |a| RSpec::Mocks::ArgumentMatchers::AnyArgMatcher === a }
8989
end
9090

9191
def no_procs_and_no_numbers?(*args)

0 commit comments

Comments
 (0)