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