Permalink
Browse files

Expose RCCounter#decrement_by

  • Loading branch information...
1 parent 30d0ac5 commit 8094c77369b0ca9a23e010c5a0b9d9d891b65cbb @jc00ke jc00ke committed Oct 21, 2012
Showing with 13 additions and 0 deletions.
  1. +1 −0 lib/ruby/1.8/maglev/rccounter.rb
  2. +12 −0 spec/maglev/reducedconflict/counter/decrement_by_spec.rb
@@ -21,4 +21,5 @@ class RCCounter
primitive 'increment', 'increment'
primitive 'increment_by', 'incrementBy:'
primitive 'decrement', 'decrement'
+ primitive 'decrement_by', 'decrementBy:'
end
@@ -0,0 +1,12 @@
+require File.expand_path('../../../../spec_helper', __FILE__)
+require 'maglev/rccounter'
+
+describe "RCCounter#decrement_by" do
+
+ it "subtracts x from the counter" do
+ counter = RCCounter.new
+ counter.decrement_by 10
+ counter.value.should == -10
+ end
+
+end

0 comments on commit 8094c77

Please sign in to comment.