[macruby-changes] [2214] MacRuby/branches/experimental/spec

source_changes at macosforge.org source_changes at macosforge.org
Tue Aug 4 19:59:35 PDT 2009


Revision: 2214
          http://trac.macosforge.org/projects/ruby/changeset/2214
Author:   lsansonetti at apple.com
Date:     2009-08-04 19:59:35 -0700 (Tue, 04 Aug 2009)
Log Message:
-----------
enabled Proc specs and tagged a few exceptions that don't run (mostly new 1.9 APIs)

Modified Paths:
--------------
    MacRuby/branches/experimental/spec/frozen/core/proc/curry_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/proc/lambda_spec.rb
    MacRuby/branches/experimental/spec/frozen/core/proc/shared/equal.rb
    MacRuby/branches/experimental/spec/macruby.mspec

Added Paths:
-----------
    MacRuby/branches/experimental/spec/frozen/tags/macruby/core/proc/new_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/macruby/core/proc/parameters_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/macruby/core/proc/source_location_tags.txt
    MacRuby/branches/experimental/spec/frozen/tags/macruby/core/proc/to_s_tags.txt

Modified: MacRuby/branches/experimental/spec/frozen/core/proc/curry_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/proc/curry_spec.rb	2009-08-05 02:58:50 UTC (rev 2213)
+++ MacRuby/branches/experimental/spec/frozen/core/proc/curry_spec.rb	2009-08-05 02:59:35 UTC (rev 2214)
@@ -82,11 +82,13 @@
       @lambda_add.curry(3).should be_an_instance_of(Proc)
     end
 
+=begin # this spec seems to fail with 1.9.2
     # [ruby-core:24127]
     it "retains the lambda-ness of the Proc on which its called" do
       @lambda_add.curry(3).lambda?.should be_true
       @proc_add.curry(3).lambda?.should be_false
     end
+=end
 
     it "raises an ArgumentError if called on a lambda that requires more than _arity_ arguments" do
       p = lambda { true }

Modified: MacRuby/branches/experimental/spec/frozen/core/proc/lambda_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/proc/lambda_spec.rb	2009-08-05 02:58:50 UTC (rev 2213)
+++ MacRuby/branches/experimental/spec/frozen/core/proc/lambda_spec.rb	2009-08-05 02:59:35 UTC (rev 2214)
@@ -14,10 +14,12 @@
       Proc.new { true }.lambda?.should be_false
     end
 
+=begin # this spec seems to fail with 1.9.2
     # [ruby-core:24127]
     it "returns true if the object was created with Proc#curry" do
       l = lambda { true }
       l.curry.lambda?.should be_true
     end
+=end
   end
 end

Modified: MacRuby/branches/experimental/spec/frozen/core/proc/shared/equal.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/proc/shared/equal.rb	2009-08-05 02:58:50 UTC (rev 2213)
+++ MacRuby/branches/experimental/spec/frozen/core/proc/shared/equal.rb	2009-08-05 02:59:35 UTC (rev 2214)
@@ -49,6 +49,7 @@
   end
 
   ruby_version_is "1.9" do
+=begin # this spec doesn't seem to pass with 1.9.2, it should probably be deleted
     it "returns true if the bodies of self and other are identical but represented by different objects" do
       foo = proc    { :foo }
       foo2 = lambda { :foo }
@@ -56,6 +57,7 @@
       p2 = proc  &foo2
       p.send(@method, p2).should be_true
     end
+=end
 
     it "returns false if other is not a Proc" do
       p = proc { :foo }

Added: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/proc/new_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/macruby/core/proc/new_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/macruby/core/proc/new_tags.txt	2009-08-05 02:59:35 UTC (rev 2214)
@@ -0,0 +1,2 @@
+fails:Proc.new with an associated block raises a LocalJumpError when context of the block no longer exists
+fails:Proc.new with an associated block returns from within enclosing method when 'return' is used in the block

Added: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/proc/parameters_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/macruby/core/proc/parameters_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/macruby/core/proc/parameters_tags.txt	2009-08-05 02:59:35 UTC (rev 2214)
@@ -0,0 +1,10 @@
+fails:Proc#parameters returns an empty Array for a proc expecting no parameters
+fails:Proc#parameters returns an Array of Arrays for a proc expecting parameters
+fails:Proc#parameters sets the first element of each sub-Array to :opt for optional arguments
+fails:Proc#parameters regards named parameters in procs as optional
+fails:Proc#parameters regards parameters with default values as optional
+fails:Proc#parameters sets the first element of each sub-Array to :req for required arguments
+fails:Proc#parameters regards named parameters in lambdas as required
+fails:Proc#parameters sets the first element of each sub-Array to :rest for parameters prefixed with asterisks
+fails:Proc#parameters sets the first element of each sub-Array to :block for parameters prefixed with ampersands
+fails:Proc#parameters sets the second element of each sub-Array to the name of the argument

Added: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/proc/source_location_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/macruby/core/proc/source_location_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/macruby/core/proc/source_location_tags.txt	2009-08-05 02:59:35 UTC (rev 2214)
@@ -0,0 +1,6 @@
+fails:Proc#source_location returns an Array
+fails:Proc#source_location sets the first value to the path of the file in which the proc was defined
+fails:Proc#source_location sets the last value to a Fixnum representing the line on which the proc was defined
+fails:Proc#source_location works even if the proc was created on the same line
+fails:Proc#source_location returns the first line of a multi-line proc (i.e. the line containing 'proc do')
+fails:Proc#source_location returns the location of the proc's body; not necessarily the proc itself

Added: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/proc/to_s_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/macruby/core/proc/to_s_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/macruby/core/proc/to_s_tags.txt	2009-08-05 02:59:35 UTC (rev 2214)
@@ -0,0 +1 @@
+fails:Proc#to_s returns a description of self

Modified: MacRuby/branches/experimental/spec/macruby.mspec
===================================================================
--- MacRuby/branches/experimental/spec/macruby.mspec	2009-08-05 02:58:50 UTC (rev 2213)
+++ MacRuby/branches/experimental/spec/macruby.mspec	2009-08-05 02:59:35 UTC (rev 2214)
@@ -17,8 +17,7 @@
     '^core/encoding',
     '^core/marshal',
     '^core/numeric/to_c_spec.rb',
-    '^core/precision',
-    '^core/proc',
+    '^core/precision'
   ]
 
   # Library specs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090804/e4422fc4/attachment.html>


More information about the macruby-changes mailing list