[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-bindings
Subject:    [Kde-bindings] qtruby and mocha
From:       Paolo Capriotti <p.capriotti () gmail ! com>
Date:       2010-02-14 11:09:15
Message-ID: 87b37d61002140309u78a9c266u173cfd499ee09dfd () mail ! gmail ! com
[Download RAW message or body]

Using mocha (http://mocha.rubyforge.org/) on QtRuby objects results in
the following error:

ArgumentError: wrong number of arguments (1 for 0)
    /var/lib/gems/1.8/gems/mocha-0.9.8/lib/mocha/instance_method.rb:8:in
`public_methods'
    /var/lib/gems/1.8/gems/mocha-0.9.8/lib/mocha/instance_method.rb:8:in
`method_exists?'
    /var/lib/gems/1.8/gems/mocha-0.9.8/lib/mocha/class_method.rb:30:in
`hide_original_method'
    /var/lib/gems/1.8/gems/mocha-0.9.8/lib/mocha/class_method.rb:15:in `stub'
    /var/lib/gems/1.8/gems/mocha-0.9.8/lib/mocha/central.rb:13:in `stub'
    /var/lib/gems/1.8/gems/mocha-0.9.8/lib/mocha/object.rb:61:in `expects'
    /var/lib/gems/1.8/gems/mocha-0.9.8/lib/mocha/argument_iterator.rb:15:in
`call'
    /var/lib/gems/1.8/gems/mocha-0.9.8/lib/mocha/argument_iterator.rb:15:in
`each'
    /var/lib/gems/1.8/gems/mocha-0.9.8/lib/mocha/object.rb:57:in `expects'
    ./test/test_utils.rb:28:in `test_painter_bracket'
    /var/lib/gems/1.8/gems/mocha-0.9.8/lib/mocha/integration/test_unit/ruby_version_186_and_above.rb:19:in
 `__send__'
    /var/lib/gems/1.8/gems/mocha-0.9.8/lib/mocha/integration/test_unit/ruby_version_186_and_above.rb:19:in
 `run'

This is because public_methods should take an optional argument. The
attached patch fixes the problem.

Paolo Capriotti


["mocha-qtruby.patch" (text/x-patch)]

--- qtruby4.rb	2010-02-14 11:05:22.068146536 +0000
+++ qtruby4-patched.rb	2010-02-14 11:03:11.568381903 +0000
@@ -216,16 +216,16 @@
 			qt_methods(super, 0x0)
 		end
 	
-		def protected_methods
+		def protected_methods(all=true)
 			# From smoke.h, Smoke::mf_protected 0x80
 			qt_methods(super, 0x80)
 		end
 	
-		def public_methods
+		def public_methods(all=true)
 			methods
 		end
 	
-		def singleton_methods
+		def singleton_methods(all=true)
 			# From smoke.h, Smoke::mf_static 0x01
 			qt_methods(super, 0x01)
 		end


_______________________________________________
Kde-bindings mailing list
Kde-bindings@kde.org
https://mail.kde.org/mailman/listinfo/kde-bindings


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic