Sha256: dd38efc24b2ee5ec743c3dc0feb54cd9938da319baba13796ae442c4dda840e2
Contents?: true
Size: 1002 Bytes
Versions: 6
Compression:
Stored size: 1002 Bytes
Contents
require 'dm-core/core_ext/array' begin require 'active_support/hash_with_indifferent_access' unless defined?(Mash) Mash = ActiveSupport::HashWithIndifferentAccess end rescue LoadError require 'extlib/mash' end 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
6 entries across 6 versions & 1 rubygems