Sha256: 66bf8fe268d34a7e085e34000c3403ab098fbcb7b198e3de53f723d7bade75ef
Contents?: true
Size: 1.04 KB
Versions: 57
Compression:
Stored size: 1.04 KB
Contents
describe "Array#uniq" do it "relies on Ruby's #hash (not JavaScript's #toString) for identifying array items" do a = [ 123, '123'] a.uniq.should == a a = [ Time.at(1429521600.1), Time.at(1429521600.9) ] a.uniq.should == a a = [ Object.new, Object.new ] a.uniq.should == a a = [ 1, 2, 3, '1', '2', '3'] a.uniq.should == a a = [ [1, 2, 3], '1,2,3'] a.uniq.should == a a = [ true, 'true'] a.uniq.should == a a = [ false, 'false'] a.uniq.should == a end end describe "Array#uniq!" do it "relies on Ruby's #hash (not JavaScript's #toString) for identifying array items" do a = [ 123, '123'] a.uniq!.should == nil a = [ Time.at(1429521600.1), Time.at(1429521600.9) ] a.uniq!.should == nil a = [ Object.new, Object.new ] a.uniq!.should == nil a = [ 1, 2, 3, '1', '2', '3'] a.uniq!.should == nil a = [ [1, 2, 3], '1,2,3'] a.uniq!.should == nil a = [ true, 'true'] a.uniq!.should == nil a = [ false, 'false'] a.uniq!.should == nil end end
Version data entries
57 entries across 57 versions & 2 rubygems