[macruby-changes] [1370] MacRuby/branches/experimental

source_changes at macosforge.org source_changes at macosforge.org
Sun Apr 5 09:56:28 PDT 2009


Revision: 1370
          http://trac.macosforge.org/projects/ruby/changeset/1370
Author:   eloy.de.enige at gmail.com
Date:     2009-04-05 09:56:28 -0700 (Sun, 05 Apr 2009)
Log Message:
-----------
Updated class_spec, eigenclass_spec, and metaclass_spec to use the new have_class_variable, have_instance_variable, and have_constant matchers.

Modified Paths:
--------------
    MacRuby/branches/experimental/mspec/lib/mspec/helpers.rb
    MacRuby/branches/experimental/spec/frozen/language/class_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/eigenclass_spec.rb
    MacRuby/branches/experimental/spec/frozen/language/metaclass_spec.rb

Modified: MacRuby/branches/experimental/mspec/lib/mspec/helpers.rb
===================================================================
--- MacRuby/branches/experimental/mspec/lib/mspec/helpers.rb	2009-04-05 16:56:12 UTC (rev 1369)
+++ MacRuby/branches/experimental/mspec/lib/mspec/helpers.rb	2009-04-05 16:56:28 UTC (rev 1370)
@@ -9,4 +9,3 @@
 require 'mspec/helpers/ruby_exe'
 require 'mspec/helpers/scratch'
 require 'mspec/helpers/tmp'
-require 'mspec/helpers/variables'

Modified: MacRuby/branches/experimental/spec/frozen/language/class_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/class_spec.rb	2009-04-05 16:56:12 UTC (rev 1369)
+++ MacRuby/branches/experimental/spec/frozen/language/class_spec.rb	2009-04-05 16:56:28 UTC (rev 1370)
@@ -60,31 +60,31 @@
 #  end
 
   it "allows the declaration of class variables in the body" do
-    ClassSpecs::B.class_variables.should == variable("@@cvar")
+    ClassSpecs::B.should have_class_variable(:@@cvar)
     ClassSpecs::B.send(:class_variable_get, :@@cvar).should == :cvar
   end
 
   it "stores instance variables defined in the class body in the class object" do
-    ClassSpecs::B.instance_variables.should include_variable("@ivar")
+    ClassSpecs::B.should have_instance_variable(:@ivar)
     ClassSpecs::B.instance_variable_get(:@ivar).should == :ivar
   end
 
   it "allows the declaration of class variables in a class method" do
     ClassSpecs::C.class_variables.should == []
     ClassSpecs::C.make_class_variable
-    ClassSpecs::C.class_variables.should == variable("@@cvar")
+    ClassSpecs::C.should have_class_variable(:@@cvar)
   end
 
   it "allows the definition of class-level instance variables in a class method" do
-    ClassSpecs::C.instance_variables.should_not include_variable("@civ")
+    ClassSpecs::C.should_not have_instance_variable(:@civ)
     ClassSpecs::C.make_class_instance_variable
-    ClassSpecs::C.instance_variables.should include_variable("@civ")
+    ClassSpecs::C.should have_instance_variable(:@civ)
   end
 
   it "allows the declaration of class variables in an instance method" do
     ClassSpecs::D.class_variables.should == []
     ClassSpecs::D.new.make_class_variable
-    ClassSpecs::D.class_variables.should == variable("@@cvar")
+    ClassSpecs::D.should have_class_variable(:@@cvar)
   end
 
   it "allows the definition of instance methods" do
@@ -115,7 +115,8 @@
 
 describe "An outer class definition" do
   it "contains the inner classes" do
-    ClassSpecs::Container.constants.should include_variables('A', 'B')
+    ClassSpecs::Container.should have_constant(:A)
+    ClassSpecs::Container.should have_constant(:B)
   end
 end
 

Modified: MacRuby/branches/experimental/spec/frozen/language/eigenclass_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/eigenclass_spec.rb	2009-04-05 16:56:12 UTC (rev 1369)
+++ MacRuby/branches/experimental/spec/frozen/language/eigenclass_spec.rb	2009-04-05 16:56:28 UTC (rev 1370)
@@ -149,12 +149,12 @@
   end
 
   it "appears in the eigenclass constant list" do
-    constants = class << @object; constants; end 
-    constants.should include_variable('CONST')
+    klass = (class << @object; self; end )
+    klass.should have_constant(:CONST)
   end
 
   it "does not appear in the object's class constant list" do
-    @object.class.constants.should_not include_variable('CONST')
+    @object.class.should_not have_constant(:CONST)
   end
 
   it "is not preserved when the object is duped" do

Modified: MacRuby/branches/experimental/spec/frozen/language/metaclass_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/metaclass_spec.rb	2009-04-05 16:56:12 UTC (rev 1369)
+++ MacRuby/branches/experimental/spec/frozen/language/metaclass_spec.rb	2009-04-05 16:56:28 UTC (rev 1370)
@@ -96,8 +96,8 @@
   end
 
   it "appears in the metaclass constant list" do
-    constants = class << @object; constants; end
-    constants.should include_variable('CONST')
+    klass = (class << @object; self; end)
+    klass.should have_constant(:CONST)
   end
 
   it "does not appear in the object's class constant list" do
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090405/16a38b2b/attachment.html>


More information about the macruby-changes mailing list