Sha256: e981ad4ad8c0ef7b038d668bdecaaa4cb84cf8df62d8762eb5555f55f6dd9c79
Contents?: true
Size: 725 Bytes
Versions: 20
Compression:
Stored size: 725 Bytes
Contents
require File.join(File.dirname(__FILE__), %w[.. .. .. spec_helper]) describe SC::HashStruct, 'merge!' do it "should convert all keys to symbols - if symbol and string is passed, they will overrwite" do a = SC::HashStruct.new a.merge! :foo => :bar1, 'foo' => :bar2 a.keys.size.should eql(1) a.keys.first.should eql(:foo) end it "should do nothing if we merge self!" do a = SC::HashStruct.new :foo => :bar a.merge! a a[:foo].should eql(:bar) a.keys.size.should eql(1) end it "should do nothing if we merge nil" do a = SC::HashStruct.new :foo => :bar lambda { a.merge! nil }.should_not raise_error a[:foo].should eql(:bar) a.keys.size.should eql(1) end end
Version data entries
20 entries across 20 versions & 2 rubygems