[macruby-changes] [528] MacRuby/trunk/test/ruby/test_objc.rb

source_changes at macosforge.org source_changes at macosforge.org
Sat Aug 30 00:34:47 PDT 2008


Revision: 528
          http://trac.macosforge.org/projects/ruby/changeset/528
Author:   lsansonetti at apple.com
Date:     2008-08-30 00:34:47 -0700 (Sat, 30 Aug 2008)
Log Message:
-----------
added more tests

Modified Paths:
--------------
    MacRuby/trunk/test/ruby/test_objc.rb

Modified: MacRuby/trunk/test/ruby/test_objc.rb
===================================================================
--- MacRuby/trunk/test/ruby/test_objc.rb	2008-08-30 07:34:32 UTC (rev 527)
+++ MacRuby/trunk/test/ruby/test_objc.rb	2008-08-30 07:34:47 UTC (rev 528)
@@ -363,4 +363,25 @@
     assert_equal(Icon, o.class)
     assert_equal('Chad', o.name)
   end
+
+  class TestKVCSetter
+    attr_accessor :foo
+  end
+  def test_KVO_setter_defined_by_attr_setter
+    o = TestKVCSetter.new
+    assert(o.respond_to?(:foo=))
+    assert(o.respond_to?(:setFoo))
+    o.setFoo(42)
+    assert(42, o.foo)
+    o.performSelector('setFoo:', withObject:42)
+    assert(42, o.foo)
+  end
+
+  def test_respond_to_objc_methods
+    s = ''
+    assert(s.respond_to?(:strip))
+    assert(s.respond_to?(:setString))
+    assert(s.respond_to?('setString:'))
+    assert(s.respond_to?('performSelector:withObject:'))
+  end
 end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macruby-changes/attachments/20080830/0d528622/attachment.html 


More information about the macruby-changes mailing list