Permalink
Browse files

Ugly hack to fix stubbing/mocking for class methods.

  • Loading branch information...
1 parent b491cbd commit e4b2feb24f69820cd5a3d46f741d1ee0414d885a @arthurschreiber committed Sep 9, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/spec/mocks/nx/method_double.tcl
@@ -39,21 +39,21 @@ namespace eval Spec::Mocks::nx {
}
if { $definition != "" } {
- return [lindex $definition 1]
+ return "[lindex $definition 1][expr {[${:object} info class] == "::nx::Class" ? " class" : ""}]"
} else {
- return "public"
+ return "public[expr {[${:object} info class] == "::nx::Class" ? " class" : ""}]"
}
}
}
:public method define_proxy_method {} {
- ${:object} [:visibility] method ${:message_name} { args } "
+ ${:object} {*}[:visibility] method ${:message_name} { args } "
\[:__mock_proxy] message_received {${:message_name}} {*}\$args
"
}
:public method undefine_proxy_method {} {
- ${:object} public method ${:message_name} {} {}
+ ${:object} {*}[:visibility] method ${:message_name} {} {}
}
:public method restore_original_method {} {

0 comments on commit e4b2feb

Please sign in to comment.