diff options
Diffstat (limited to 'spec/ruby/core/array/length_spec.rb')
| -rw-r--r-- | spec/ruby/core/array/length_spec.rb | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/spec/ruby/core/array/length_spec.rb b/spec/ruby/core/array/length_spec.rb index 6f4469dda5..74b2eb3a08 100644 --- a/spec/ruby/core/array/length_spec.rb +++ b/spec/ruby/core/array/length_spec.rb @@ -1,7 +1,14 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require File.expand_path('../fixtures/classes', __FILE__) -require File.expand_path('../shared/length', __FILE__) +require_relative '../../spec_helper' +require_relative 'fixtures/classes' describe "Array#length" do - it_behaves_like(:array_length, :length) + 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 |
