diff options
author | Jim Myhrberg <contact@jimeh.me> | 2013-03-02 14:34:25 +0000 |
---|---|---|
committer | Jim Myhrberg <contact@jimeh.me> | 2013-03-02 14:34:25 +0000 |
commit | bfba1a610172daa6b2eda15b917d2ca521149d27 (patch) | |
tree | da08df2679b42f8e1c0cf1280cb5b76338b055f5 | |
parent | cb57717fb6f3e309ff84f369327af6f97209951f (diff) | |
download | hashie-bfba1a610172daa6b2eda15b917d2ca521149d27.tar.gz |
Ensure #replace works with Hashie::Clash
-rw-r--r-- | spec/hashie/clash_spec.rb | 9 |
1 files changed, 9 insertions, 0 deletions
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 |