Permalink
Browse files

Spec for merge! returning self.

  • Loading branch information...
1 parent 6d347f6 commit f3b4d2d96a97dffe7cdb294a966a4645c6c58d2f @jnunemaker jnunemaker committed Oct 11, 2012
Showing with 2 additions and 1 deletion.
  1. +1 −0 lib/plucky/criteria_hash.rb
  2. +1 −1 spec/plucky/criteria_hash_spec.rb
@@ -101,6 +101,7 @@ def merge!(other)
merge(other).to_hash.each do |key, value|
self[key] = value
end
+ self
end
def object_ids
@@ -144,7 +144,7 @@
it "updates mergee" do
c1 = described_class.new(:foo => 'bar')
c2 = described_class.new(:foo => 'baz')
- c1.merge!(c2)
+ c1.merge!(c2).should equal(c1)
c1[:foo].should == {:$in => ['bar', 'baz']}
end
end

0 comments on commit f3b4d2d

Please sign in to comment.