Sha256: 8d10123646285128538bb1503b91a44c58d2b6fdbfcf9f1c975a5489285396fa

Contents?: true

Size: 854 Bytes

Versions: 23

Compression:

Stored size: 854 Bytes

Contents

require File.expand_path(File.join(File.dirname(__FILE__), 'spec_helper'))

describe Array do
  before :all do
    @array = [ [ :a, [ 1 ] ], [ :b, [ 2 ] ], [ :c, [ 3 ] ] ].freeze
  end

  it { @array.should respond_to(:to_hash) }

  describe '#to_hash' do
    before :all do
      @return = @array.to_hash
    end

    it 'should return a Hash' do
      @return.should be_kind_of(Hash)
    end

    it 'should return expected value' do
      @return.should == { :a => [ 1 ], :b => [ 2 ], :c => [ 3 ] }
    end
  end

  it { @array.should respond_to(:to_mash) }

  describe '#to_mash' do
    before :all do
      @return = @array.to_mash
    end

    it 'should return a Mash' do
      @return.should be_kind_of(Mash)
    end

    it 'should return expected value' do
      @return.should == { 'a' => [ 1 ], 'b' => [ 2 ], 'c' => [ 3 ] }
    end
  end
end

Version data entries

23 entries across 22 versions & 5 rubygems

Version Path
sundbp-extlib-0.9.14 spec/array_spec.rb
middleman-0.13.1 lib/middleman/vendor/gems/ruby/1.9.1/gems/extlib-0.9.14/spec/array_spec.rb
middleman-0.13.1 lib/middleman/vendor/gems/ruby/1.8/gems/extlib-0.9.14/spec/array_spec.rb
middleman-0.12.2 lib/middleman/vendor/gems/gems/extlib-0.9.14/spec/array_spec.rb
middleman-0.12.1 lib/middleman/vendor/gems/gems/extlib-0.9.14/spec/array_spec.rb
extlib-0.9.14 spec/array_spec.rb
ginst-2009.12.8 vendor/gems/extlib-0.9.13/spec/array_spec.rb
middleman-0.12.0.pre3 lib/middleman/vendor/gems/gems/extlib-0.9.13/spec/array_spec.rb
middleman-0.12.0.pre2 lib/middleman/vendor/gems/gems/extlib-0.9.13/spec/array_spec.rb
middleman-0.12.0.pre lib/middleman/vendor/gems/gems/extlib-0.9.13/spec/array_spec.rb
ginst-2009.11.24 vendor/gems/extlib-0.9.13/spec/array_spec.rb
ginst-2009.11.23 vendor/gems/extlib-0.9.13/spec/array_spec.rb
rango-0.0.6 vendor/extlib/spec/array_spec.rb
rango-0.1.pre vendor/extlib/spec/array_spec.rb
middleman-0.10.17 vendor/gems/gems/extlib-0.9.13/spec/array_spec.rb
middleman-0.10.16 vendor/gems/gems/extlib-0.9.13/spec/array_spec.rb
middleman-0.10.15 vendor/gems/gems/extlib-0.9.13/spec/array_spec.rb
middleman-0.10.14 vendor/gems/gems/extlib-0.9.13/spec/array_spec.rb
ginst-2.0.1 vendor/gems/extlib-0.9.13/spec/array_spec.rb
ginst-2.0.0 vendor/gems/extlib-0.9.13/spec/array_spec.rb