[macruby-changes] [5118] MacRuby/trunk/spec/macruby/core/struct_spec.rb

source_changes at macosforge.org source_changes at macosforge.org
Tue Jan 4 21:51:22 PST 2011


Revision: 5118
          http://trac.macosforge.org/projects/ruby/changeset/5118
Author:   lsansonetti at apple.com
Date:     2011-01-04 21:51:18 -0800 (Tue, 04 Jan 2011)
Log Message:
-----------
add spec for #size method on struct classes

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

Modified: MacRuby/trunk/spec/macruby/core/struct_spec.rb
===================================================================
--- MacRuby/trunk/spec/macruby/core/struct_spec.rb	2011-01-05 05:50:15 UTC (rev 5117)
+++ MacRuby/trunk/spec/macruby/core/struct_spec.rb	2011-01-05 05:51:18 UTC (rev 5118)
@@ -212,6 +212,18 @@
     end
   end
 
+  it "returns the sizeof of the C structure when the #size class method is called" do
+    if RUBY_ARCH == 'x86_64'
+      NSPoint.size.should == 16
+      NSSize.size.should == 16
+      NSRect.size.should == 32
+    else
+      NSPoint.size.should == 8
+      NSSize.size.should == 8
+      NSRect.size.should == 16
+    end
+  end
+
   if MACOSX_VERSION <= 10.6
     it "defined after a structure which has the same type is an alias to the other structure class" do
       NSPoint.should == CGPoint
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20110104/05d9608e/attachment-0001.html>


More information about the macruby-changes mailing list