diff options
Diffstat (limited to 'spec/ruby/core/array/length_spec.rb')
| -rw-r--r-- | spec/ruby/core/array/length_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/ruby/core/array/length_spec.rb b/spec/ruby/core/array/length_spec.rb new file mode 100644 index 0000000000..74b2eb3a08 --- /dev/null +++ b/spec/ruby/core/array/length_spec.rb @@ -0,0 +1,14 @@ +require_relative '../../spec_helper' +require_relative 'fixtures/classes' + +describe "Array#length" do + it "returns the number of elements" do + [].length.should == 0 + [1, 2, 3].length.should == 3 + end + + it "properly handles recursive arrays" do + ArraySpecs.empty_recursive_array.length.should == 1 + ArraySpecs.recursive_array.length.should == 8 + end +end |
