Permalink
Browse files

Implement Statsd#decrement

  • Loading branch information...
1 parent b7c7b0c commit 6992f7d2538b8f2991a93fa0cab9386eebf1d798 Rein Henrichs committed Feb 19, 2011
Showing with 11 additions and 0 deletions.
  1. +4 −0 lib/statsd.rb
  2. +7 −0 spec/statsd_spec.rb
View
@@ -8,6 +8,10 @@ def increment(stat)
socket.send("#{stat}:1|c")
end
+ def decrement(stat)
+ socket.send("#{stat}:-1|c")
+ end
+
private
def socket
View
@@ -24,4 +24,11 @@ def socket
end
end
+ describe "#decrement" do
+ it "should format the message according to the statsd spec" do
+ @statsd.decrement('foobar')
+ @statsd.socket.recv.must_equal ['foobar:-1|c']
+ end
+ end
+
end

0 comments on commit 6992f7d

Please sign in to comment.