[macruby-changes] [3464] MacRuby/trunk/spec/macruby/library/dispatch/enumerable_spec.rb

source_changes at macosforge.org source_changes at macosforge.org
Tue Feb 9 15:23:42 PST 2010


Revision: 3464
          http://trac.macosforge.org/projects/ruby/changeset/3464
Author:   ernest.prabhakar at gmail.com
Date:     2010-02-09 15:23:38 -0800 (Tue, 09 Feb 2010)
Log Message:
-----------
Spec to ensure Enumerable#p_each is happening concurrently

Modified Paths:
--------------
    MacRuby/trunk/spec/macruby/library/dispatch/enumerable_spec.rb

Modified: MacRuby/trunk/spec/macruby/library/dispatch/enumerable_spec.rb
===================================================================
--- MacRuby/trunk/spec/macruby/library/dispatch/enumerable_spec.rb	2010-02-09 22:46:04 UTC (rev 3463)
+++ MacRuby/trunk/spec/macruby/library/dispatch/enumerable_spec.rb	2010-02-09 23:23:38 UTC (rev 3464)
@@ -22,7 +22,11 @@
       end
       
       it "should execute concurrently" do
-        true.should == true
+        t0 = Time.now
+        @ary.p_each {|v| sleep v/100.0}
+        t1 = Time.now
+        t_total = @ary.inject(0) {|a,b| a + b/100.0}
+        (t1-t0).to_f.should < t_total
       end
     end
     
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100209/965bc786/attachment.html>


More information about the macruby-changes mailing list