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