Sha256: 8edd5073f3db49ca6bcdd288a4753265cdd39e169b5c61a196b1c0139ea65163

Contents?: true

Size: 818 Bytes

Versions: 57

Compression:

Stored size: 818 Bytes

Contents

describe "Array#-" do
  it "relies on Ruby's #hash (not JavaScript's #toString) for identifying array items" do
    a1 = [ 123 ]
    a2 = ['123']
    (a1 - a2).should == a1
    (a2 - a1).should == a2

    a1 = [ Time.at(1429521600.1) ]
    a2 = [ Time.at(1429521600.9) ]
    (a1 - a2).should == a1
    (a2 - a1).should == a2

    a1 = [ Object.new ]
    a2 = [ Object.new ]
    (a1 - a2).should == a1
    (a2 - a1).should == a2

    a1 = [ 1, 2, 3 ]
    a2 = ['1', '2', '3']
    (a1 - a2).should == a1
    (a2 - a1).should == a2

    a1 = [ 1, 2, 3 ]
    a2 = ['1,2,3']
    (a1 - a2).should == a1
    (a2 - a1).should == a2

    a1 = [ true ]
    a2 = ['true']
    (a1 - a2).should == a1
    (a2 - a1).should == a2

    a1 = [ false ]
    a2 = ['false']
    (a1 - a2).should == a1
    (a2 - a1).should == a2
  end
end

Version data entries

57 entries across 57 versions & 2 rubygems

Version Path
opal-1.4.0 spec/opal/core/array/minus_spec.rb
opal-1.4.0.alpha1 spec/opal/core/array/minus_spec.rb
opal-1.3.2 spec/opal/core/array/minus_spec.rb
opal-1.3.1 spec/opal/core/array/minus_spec.rb
opal-1.3.0 spec/opal/core/array/minus_spec.rb
opal-1.3.0.rc1 spec/opal/core/array/minus_spec.rb
opal-1.3.0.alpha1 spec/opal/core/array/minus_spec.rb
opal-1.2.0 spec/opal/core/array/minus_spec.rb
opal-1.2.0.beta1 spec/opal/core/array/minus_spec.rb
opal-1.1.1 spec/opal/core/array/minus_spec.rb
opal-1.1.1.rc1 spec/opal/core/array/minus_spec.rb
opal-1.1.0 spec/opal/core/array/minus_spec.rb
opal-1.1.0.rc1 spec/opal/core/array/minus_spec.rb
opal-0.10.6 spec/opal/core/array/minus_spec.rb
opal-0.10.6.beta spec/opal/core/array/minus_spec.rb
opal-0.10.5 spec/opal/core/array/minus_spec.rb
opal-0.10.4 spec/opal/core/array/minus_spec.rb
opal-0.11.0.rc1 spec/opal/core/array/minus_spec.rb
opal-0.10.3 spec/opal/core/array/minus_spec.rb
opal-0.10.2 spec/opal/core/array/minus_spec.rb