Skip to content

Commit

Permalink
Ugly hack to fix stubbing/mocking for class methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurschreiber committed Sep 9, 2012
1 parent b491cbd commit e4b2feb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/spec/mocks/nx/method_double.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -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 {} {
Expand Down

0 comments on commit e4b2feb

Please sign in to comment.