Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #276 from alexdowad/array_eql_checks_type

Add spec to ensure that Array#eql? checks type of argument
  • Loading branch information...
commit 4fbc8a10694fa579a3b7b64b66380a4348ea6074 2 parents 903c837 + 34374f6
@brixen brixen authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 core/array/eql_spec.rb
View
7 core/array/eql_spec.rb
@@ -12,4 +12,11 @@
[1, 2, 3, 4].send(@method, [1, 2, 3, 4.0]).should be_false
end
+ it "returns false if other is not a kind of Array" do
+ obj = mock("array eql?")
+ obj.should_not_receive(:to_ary)
+ obj.should_not_receive(:==)
+
+ [1, 2, 3].eql?(obj).should be_false
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.