Sha256: f04e1d3ffb8ae1f600afb7cf8dcb3f284770df4433734ef0348ab069b3223c31

Contents?: true

Size: 436 Bytes

Versions: 4

Compression:

Stored size: 436 Bytes

Contents

require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../fixtures/classes', __FILE__)

ruby_version_is "1.9" do
  describe "Array.try_convert" do
    it "returns the argument if it's a Array" do
      x = Array.new
      Array.try_convert(x).should equal(x)
    end

    it "returns nil when the argument does not respond to #to_ary" do
      Array.try_convert(Object.new).should be_nil
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
opal-0.3.41 spec/core/array/try_convert_spec.rb
opal-0.3.40 spec/core/array/try_convert_spec.rb
opal-0.3.39 spec/core/array/try_convert_spec.rb
opal-0.3.38 spec/core/array/try_convert_spec.rb