[macruby-changes] [3322] MacRuby/trunk/spec/macruby/core/gcd/queue_spec.rb

source_changes at macosforge.org source_changes at macosforge.org
Fri Jan 22 17:06:43 PST 2010


Revision: 3322
          http://trac.macosforge.org/projects/ruby/changeset/3322
Author:   ernest.prabhakar at gmail.com
Date:     2010-01-22 17:06:40 -0800 (Fri, 22 Jan 2010)
Log Message:
-----------
Added index to Dispatch::Queue#apply specs

Modified Paths:
--------------
    MacRuby/trunk/spec/macruby/core/gcd/queue_spec.rb

Modified: MacRuby/trunk/spec/macruby/core/gcd/queue_spec.rb
===================================================================
--- MacRuby/trunk/spec/macruby/core/gcd/queue_spec.rb	2010-01-22 01:21:58 UTC (rev 3321)
+++ MacRuby/trunk/spec/macruby/core/gcd/queue_spec.rb	2010-01-23 01:06:40 UTC (rev 3322)
@@ -102,12 +102,12 @@
     end
 
     describe :apply do
-      it "accepts an input size and a block and yields it as many times" do
+      it "accepts a count and a block and yields it that many times, with an index" do
         @i = 0
-        @q.apply(10) { @i += 1 }
-        @i.should == 10
+        @q.apply(10) { |j| @i += j }
+        @i.should == 45
         @i = 42
-        @q.apply(0) { @i += 1 }
+        @q.apply(0) { |j| @i += 1 }
         @i.should == 42
 
         lambda { @q.apply(nil) {} }.should raise_error(TypeError) 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100122/31cdd7ba/attachment.html>


More information about the macruby-changes mailing list