From bfba1a610172daa6b2eda15b917d2ca521149d27 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Sat, 2 Mar 2013 14:34:25 +0000 Subject: Ensure #replace works with Hashie::Clash --- spec/hashie/clash_spec.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spec/hashie/clash_spec.rb b/spec/hashie/clash_spec.rb index 6797a4a..beb342c 100644 --- a/spec/hashie/clash_spec.rb +++ b/spec/hashie/clash_spec.rb @@ -39,4 +39,13 @@ describe Hashie::Clash do @c.where(:abc => 'def').where(:hgi => 123) @c.should == {:where => {:abc => 'def', :hgi => 123}} end + + it 'should be able to replace all of its own keys with #replace' do + @c.foo(:bar).hello(:world) + @c.replace(:baz => 123, :hgi => 123) + @c.keys.sort.should == [:baz, :hgi] + @c.should == {:baz => 123, :hgi => 123} + @c[:foo].should be_nil + @c[:hello].should be_nil + end end -- cgit v1.2.1