[macruby-changes] [2362] MacRuby/trunk/spec/frozen/language/private_spec.rb

source_changes at macosforge.org source_changes at macosforge.org
Sun Aug 23 19:40:32 PDT 2009


Revision: 2362
          http://trac.macosforge.org/projects/ruby/changeset/2362
Author:   lsansonetti at apple.com
Date:     2009-08-23 19:40:28 -0700 (Sun, 23 Aug 2009)
Log Message:
-----------
rewrote 2 specs so that they pass under both 1.8 and 1.9 (because const lookup is different)

Modified Paths:
--------------
    MacRuby/trunk/spec/frozen/language/private_spec.rb

Modified: MacRuby/trunk/spec/frozen/language/private_spec.rb
===================================================================
--- MacRuby/trunk/spec/frozen/language/private_spec.rb	2009-08-24 01:32:25 UTC (rev 2361)
+++ MacRuby/trunk/spec/frozen/language/private_spec.rb	2009-08-24 02:40:28 UTC (rev 2362)
@@ -57,26 +57,20 @@
   end
 
   it "changes visibility of previously called method" do
-    f = Private::F.new
+    klass = Private::F
+    f = klass.new
     f.foo
-    module Private
-      class F
-        private :foo
-      end
-    end
+    klass.class_eval { private :foo }
     lambda { f.foo }.should raise_error(NoMethodError)
   end
 
   it "changes visiblity of previously called methods with same send/call site" do
-    g = Private::G.new
+    klass = Private::G
+    g = klass.new
     lambda {
       2.times do
         g.foo
-        module Private
-          class G
-            private :foo
-          end
-        end
+        klass.class_eval { private :foo }
       end
     }.should raise_error(NoMethodError)
   end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090823/795e7fe6/attachment.html>


More information about the macruby-changes mailing list