Sha256: a7986ea6064decfc161d7e3449595831775be59ef02d8ae45d41dd19387a8fb0

Contents?: true

Size: 826 Bytes

Versions: 83

Compression:

Stored size: 826 Bytes

Contents

require File.dirname(File.join(__rhoGetCurrentDir(), __FILE__)) + '/../../spec_helper'
require File.dirname(File.join(__rhoGetCurrentDir(), __FILE__)) + '/fixtures/classes'
require File.dirname(File.join(__rhoGetCurrentDir(), __FILE__)) + '/shared/eql'

describe "Array#==" do
  it_behaves_like :array_eql, :==

  it "returns false if any corresponding elements are not #==" do
    a = ["a", "b", "c"]
    b = ["a", "b", "not equal value"]
    a.should_not == b

    c = mock("c")
    c.should_receive(:==).and_return(false)
    ["a", "b", c].should_not == a
  end

  it "returns true if corresponding elements are #==" do
    [].should == []
    ["a", "c", 7].should == ["a", "c", 7]

    [1, 2, 3].should == [1.0, 2.0, 3.0]

    obj = mock('5')
    obj.should_receive(:==).and_return(true)
    [obj].should == [5]
  end
end

Version data entries

83 entries across 83 versions & 1 rubygems

Version Path
rhodes-3.1.1 spec/framework_spec/app/spec/core/array/equal_value_spec.rb
rhodes-3.1.1.beta spec/framework_spec/app/spec/core/array/equal_value_spec.rb
rhodes-3.1.0 spec/framework_spec/app/spec/core/array/equal_value_spec.rb
rhodes-3.1.0.beta.5 spec/framework_spec/app/spec/core/array/equal_value_spec.rb
rhodes-3.1.0.beta.4 spec/framework_spec/app/spec/core/array/equal_value_spec.rb
rhodes-3.1.0.beta.3 spec/framework_spec/app/spec/core/array/equal_value_spec.rb
rhodes-3.1.0.beta.2 spec/framework_spec/app/spec/core/array/equal_value_spec.rb
rhodes-3.1.0.beta.1 spec/framework_spec/app/spec/core/array/equal_value_spec.rb
rhodes-3.0.2 spec/framework_spec/app/spec/core/array/equal_value_spec.rb
rhodes-3.0.2.beta.1 spec/framework_spec/app/spec/core/array/equal_value_spec.rb
rhodes-3.0.1 spec/framework_spec/app/spec/core/array/equal_value_spec.rb
rhodes-3.0.1.beta.8 spec/framework_spec/app/spec/core/array/equal_value_spec.rb
rhodes-3.0.1.beta.7 spec/framework_spec/app/spec/core/array/equal_value_spec.rb
rhodes-3.0.1.beta.6 spec/framework_spec/app/spec/core/array/equal_value_spec.rb
rhodes-3.0.1.beta.5 spec/framework_spec/app/spec/core/array/equal_value_spec.rb
rhodes-3.0.1.beta.4 spec/framework_spec/app/spec/core/array/equal_value_spec.rb
rhodes-3.0.1.beta.3 spec/framework_spec/app/spec/core/array/equal_value_spec.rb
rhodes-3.0.1.beta.2 spec/framework_spec/app/spec/core/array/equal_value_spec.rb
rhodes-3.0.0 spec/framework_spec/app/spec/core/array/equal_value_spec.rb
rhodes-3.0.0.beta.7 spec/framework_spec/app/spec/core/array/equal_value_spec.rb