Sha256: 3e46ca7578e34425e786828036fe1b128809a5bde062cb6c25151de03962319d

Contents?: true

Size: 476 Bytes

Versions: 14

Compression:

Stored size: 476 Bytes

Contents

describe 'array' do
  describe "wrap" do
    it "should return empty array for nil" do
      Array.wrap(nil).should == []
    end
    
    it "should return unchanged array for array" do
      Array.wrap([1, 2, 3]).should == [1, 2, 3]
    end
    
    it "should not flatten multidimensional array" do
      Array.wrap([[1], [2], [3]]).should == [[1], [2], [3]]
    end
    
    it "should turn simple object into array" do
      Array.wrap(0).should == [0]
    end
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
motion-support-1.2.1 spec/motion-support/core_ext/array/wrap_spec.rb
motion-support-1.1.1 spec/motion-support/core_ext/array/wrap_spec.rb
motion-support-1.2.0 spec/motion-support/core_ext/array/wrap_spec.rb
motion-support-1.1.0 spec/motion-support/core_ext/array/wrap_spec.rb
motion-support-1.0.0 spec/motion-support/core_ext/array/wrap_spec.rb
motion-support-0.3.0 spec/motion-support/core_ext/array/wrap_spec.rb
motion_blender-support-0.2.8 spec/motion-support/core_ext/array/wrap_spec.rb
motion_blender-support-0.2.7 spec/motion-support/core_ext/array/wrap_spec.rb
motion-support-0.2.6 spec/motion-support/core_ext/array/wrap_spec.rb
motion-support-0.2.5 spec/motion-support/core_ext/array/wrap_spec.rb
motion-support-0.2.4 spec/motion-support/core_ext/array/wrap_spec.rb
motion-support-0.2.3 spec/motion-support/core_ext/array/wrap_spec.rb
motion-support-0.2.2 spec/motion-support/core_ext/array/wrap_spec.rb
motion-support-0.2.0 spec/motion-support/core_ext/array/wrap_spec.rb