[macruby-changes] [1436] MacRuby/branches/experimental/spec/frozen/macruby

source_changes at macosforge.org source_changes at macosforge.org
Tue Apr 21 01:03:09 PDT 2009


Revision: 1436
          http://trac.macosforge.org/projects/ruby/changeset/1436
Author:   lsansonetti at apple.com
Date:     2009-04-21 01:03:08 -0700 (Tue, 21 Apr 2009)
Log Message:
-----------
added a test for NSRange

Modified Paths:
--------------
    MacRuby/branches/experimental/spec/frozen/macruby/fixtures/method.m
    MacRuby/branches/experimental/spec/frozen/macruby/method_spec.rb

Modified: MacRuby/branches/experimental/spec/frozen/macruby/fixtures/method.m
===================================================================
--- MacRuby/branches/experimental/spec/frozen/macruby/fixtures/method.m	2009-04-21 07:55:43 UTC (rev 1435)
+++ MacRuby/branches/experimental/spec/frozen/macruby/fixtures/method.m	2009-04-21 08:03:08 UTC (rev 1436)
@@ -156,6 +156,11 @@
     return NSMakeRect(1, 2, 3, 4);
 }
 
+- (NSRange)methodReturningNSRange
+{
+    return NSMakeRange(0, 42);
+}
+
 @end
 
 void

Modified: MacRuby/branches/experimental/spec/frozen/macruby/method_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/macruby/method_spec.rb	2009-04-21 07:55:43 UTC (rev 1435)
+++ MacRuby/branches/experimental/spec/frozen/macruby/method_spec.rb	2009-04-21 08:03:08 UTC (rev 1436)
@@ -286,4 +286,14 @@
     b.size.width.should == 3.0
     b.size.height.should == 4.0
   end
+
+  it "returning 'NSRange' returns an NSRange boxed object in Ruby" do
+    o = TestMethod.new
+    b = o.methodReturningNSRange
+    b.class.should == NSRange
+    b.location.class.should == Fixnum
+    b.location.should == 0
+    b.length.class.should == Fixnum
+    b.length.should == 42
+  end
 end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090421/1d54f197/attachment-0001.html>


More information about the macruby-changes mailing list