Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- zip(a, b).all? {|pair| pair[0] === pair[1]}
- [1,2].zip([3,4]) => [[1,3],[2,4]]
- a.zip(b).all? {|pair| pair[0] === pair[1]}
- a.zip(b).all? {|a,b| a === b }
- a.eql?(b)
- a = %w[a b c]
- b = %w[1 2 3]
- c = ['a', 'b', 'c']
- a.eql?(b) # => false
- a.eql?(c) # => true
- a.eql?(c.reverse) # => false
- it "returns true if other has the same length and each pair of corresponding elements are eql" do
- a = [1, 2, 3, 4]
- b = [1, 2, 3, 4]
- a.should eql(b)
- [].should eql([])
- end
Add Comment
Please, Sign In to add comment