Sha256: 49888b76ed15b56a81c55225b181410c2255248521606930ae6db7f61bd02c76
Contents?: true
Size: 986 Bytes
Versions: 17
Compression:
Stored size: 986 Bytes
Contents
require File.dirname(__FILE__) + '/../spec_helper.rb' require 'reek/smells/smells' require 'yaml' include Reek describe 'Config' do before :each do @first = { 'one' => {'two' => 3, 'three' => 4}, 'two' => {'four' => true} } end it 'should deep merge Hashes' do other = Hash.new {|hash,key| hash[key] = {} } other['one']['gunk'] = 45 other['two']['four'] = false other.push_keys(@first) @first['two']['four'].should == false @first['one'].keys.length.should == 3 end it 'should deep copy Hashes' do second = @first.deep_copy second['two'].object_id.should_not be_eql(@first['two'].object_id) end it 'should merge array values' do @first['three'] = [1,2,3] end end describe Config, 'merging arrays' do it 'should merge array values' do first = {'key' => {'one' => [1,2,3]}} second = {'key' => {'one' => [4,5]}} second.push_keys(first) first['key']['one'].should == [1,2,3,4,5] end end
Version data entries
17 entries across 17 versions & 3 rubygems