[macruby-changes] [4574] MacRuby/trunk/spec/macruby/language/method_spec.rb

source_changes at macosforge.org source_changes at macosforge.org
Mon Oct 4 16:10:13 PDT 2010


Revision: 4574
          http://trac.macosforge.org/projects/ruby/changeset/4574
Author:   lsansonetti at apple.com
Date:     2010-10-04 16:10:12 -0700 (Mon, 04 Oct 2010)
Log Message:
-----------
covering #define_method with objc-style selectors

Modified Paths:
--------------
    MacRuby/trunk/spec/macruby/language/method_spec.rb

Modified: MacRuby/trunk/spec/macruby/language/method_spec.rb
===================================================================
--- MacRuby/trunk/spec/macruby/language/method_spec.rb	2010-10-04 23:09:52 UTC (rev 4573)
+++ MacRuby/trunk/spec/macruby/language/method_spec.rb	2010-10-04 23:10:12 UTC (rev 4574)
@@ -87,4 +87,13 @@
     def @o.isFoo; end
     @o.should_not have_method(:'foo?')
   end
+
+  it "can be defined with keyword arguments via #define_method" do
+    class << @o
+      define_method(:'foo:bar:') do |a, b|
+        a + b
+      end
+    end
+    @o.foo(40, bar: 2).should == 42
+  end
 end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20101004/ee2db7f8/attachment.html>


More information about the macruby-changes mailing list