Sha256: 59d6caca0c09777e21bbda6b24c36ee60ec877df87255da490ceaee9547835a8

Contents?: true

Size: 345 Bytes

Versions: 23

Compression:

Stored size: 345 Bytes

Contents

describe "Array#rassoc" do
  it "returns the first contained array whose second element it == object" do
    ary = [[1, "a", 0.5], [2, "b"], [3, "b"], [4, "c"], [], [5], [6, "d"]]
    ary.rassoc("a").should == [1, "a", 0.5]
    ary.rassoc("b").should == [2, "b"]
    ary.rassoc("d").should == [6, "d"]
    ary.rassoc("z").should == nil
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
opal-0.3.41 spec/core/array/rassoc_spec.rb
opal-0.3.40 spec/core/array/rassoc_spec.rb
opal-0.3.39 spec/core/array/rassoc_spec.rb
opal-0.3.38 spec/core/array/rassoc_spec.rb
opal-0.3.37 spec/core/array/rassoc_spec.rb
opal-0.3.36 spec/core/array/rassoc_spec.rb
opal-0.3.35 spec/core/array/rassoc_spec.rb
opal-0.3.34 spec/core/array/rassoc_spec.rb
opal-0.3.33 spec/core/array/rassoc_spec.rb
opal-0.3.32 spec/core/array/rassoc_spec.rb
opal-0.3.31 spec/core/array/rassoc_spec.rb
opal-0.3.30 spec/core/array/rassoc_spec.rb
opal-0.3.29 spec/core/array/rassoc_spec.rb
opal-0.3.28 spec/core/array/rassoc_spec.rb
opal-0.3.27 spec/core/array/rassoc_spec.rb
opal-0.3.26 spec/core/array/rassoc_spec.rb
opal-0.3.25 spec/core/array/rassoc_spec.rb
opal-0.3.22 spec/core/array/rassoc_spec.rb
opal-0.3.21 test/core/array/rassoc_spec.rb
opal-0.3.20 test/core/array/rassoc_spec.rb