Sha256: 45dd7f542688a3a622ef6f842620dd338453cdc0d9fcae8daed54da2caa60355

Contents?: true

Size: 897 Bytes

Versions: 83

Compression:

Stored size: 897 Bytes

Contents

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

describe "Array.[]" do
  it "returns a new array populated with the given elements" do
    obj = Object.new
    Array.[](5, true, nil, 'a', "Ruby", obj).should == [5, true, nil, "a", "Ruby", obj]

    a = ArraySpecs::MyArray.[](5, true, nil, 'a', "Ruby", obj)
    a.class.should == ArraySpecs::MyArray
    a.inspect.should == [5, true, nil, "a", "Ruby", obj].inspect
  end
end

describe "Array[]" do
  it "is a synonym for .[]" do
    obj = Object.new
    Array[5, true, nil, 'a', "Ruby", obj].should == Array.[](5, true, nil, "a", "Ruby", obj)

    a = ArraySpecs::MyArray[5, true, nil, 'a', "Ruby", obj]
    a.class.should == ArraySpecs::MyArray
    a.inspect.should == [5, true, nil, "a", "Ruby", obj].inspect
  end
end

Version data entries

83 entries across 83 versions & 1 rubygems

Version Path
rhodes-3.0.0.beta.6 spec/framework_spec/app/spec/core/array/constructor_spec.rb
rhodes-3.0.0.beta.5 spec/framework_spec/app/spec/core/array/constructor_spec.rb
rhodes-3.0.0.beta.4 spec/framework_spec/app/spec/core/array/constructor_spec.rb
rhodes-3.0.0.beta.3 spec/framework_spec/app/spec/core/array/constructor_spec.rb
rhodes-3.0.0.beta.2 spec/framework_spec/app/spec/core/array/constructor_spec.rb
rhodes-3.0.0.beta.1 spec/framework_spec/app/spec/core/array/constructor_spec.rb
rhodes-2.4.1 spec/framework_spec/app/spec/core/array/constructor_spec.rb
rhodes-2.4.1.beta.1 spec/framework_spec/app/spec/core/array/constructor_spec.rb
rhodes-2.4.0 spec/framework_spec/app/spec/core/array/constructor_spec.rb
rhodes-2.4.0.beta.2 spec/framework_spec/app/spec/core/array/constructor_spec.rb
rhodes-2.4.0.beta.1 spec/framework_spec/app/spec/core/array/constructor_spec.rb
rhodes-2.3.2 spec/framework_spec/app/spec/core/array/constructor_spec.rb
rhodes-2.3.2.beta.2 spec/framework_spec/app/spec/core/array/constructor_spec.rb
rhodes-2.3.2.beta.1 spec/framework_spec/app/spec/core/array/constructor_spec.rb
rhodes-2.3.1 spec/framework_spec/app/spec/core/array/constructor_spec.rb
rhodes-2.3.1.beta.1 spec/framework_spec/app/spec/core/array/constructor_spec.rb
rhodes-2.3.0 spec/framework_spec/app/spec/core/array/constructor_spec.rb
rhodes-2.3.0.beta.3 spec/framework_spec/app/spec/core/array/constructor_spec.rb
rhodes-2.3.0.beta.2 spec/framework_spec/app/spec/core/array/constructor_spec.rb
rhodes-2.3.0.beta.1 spec/framework_spec/app/spec/core/array/constructor_spec.rb