Sha256: 6a8a5185967245ded90dd11cd1f5ab415d9b709b8f8787e7e398ca85b67a4110

Contents?: true

Size: 439 Bytes

Versions: 14

Compression:

Stored size: 439 Bytes

Contents

describe 'array options' do
  describe "extract_options!" do
    it "should extract an options hash from an array" do
      [1, 2, :a => :b].extract_options!.should == { :a => :b }
    end
    
    it "should return an empty hash if the last element is not a hash" do
      [1, 2].extract_options!.should == {}
    end
    
    it "should return an empty hash on an empty array" do
      [].extract_options!.should == {}
    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/extract_options_spec.rb
motion-support-1.1.1 spec/motion-support/core_ext/array/extract_options_spec.rb
motion-support-1.2.0 spec/motion-support/core_ext/array/extract_options_spec.rb
motion-support-1.1.0 spec/motion-support/core_ext/array/extract_options_spec.rb
motion-support-1.0.0 spec/motion-support/core_ext/array/extract_options_spec.rb
motion-support-0.3.0 spec/motion-support/core_ext/array/extract_options_spec.rb
motion_blender-support-0.2.8 spec/motion-support/core_ext/array/extract_options_spec.rb
motion_blender-support-0.2.7 spec/motion-support/core_ext/array/extract_options_spec.rb
motion-support-0.2.6 spec/motion-support/core_ext/array/extract_options_spec.rb
motion-support-0.2.5 spec/motion-support/core_ext/array/extract_options_spec.rb
motion-support-0.2.4 spec/motion-support/core_ext/array/extract_options_spec.rb
motion-support-0.2.3 spec/motion-support/core_ext/array/extract_options_spec.rb
motion-support-0.2.2 spec/motion-support/core_ext/array/extract_options_spec.rb
motion-support-0.2.0 spec/motion-support/core_ext/array/extract_options_spec.rb