From: Erik Veenstra Date: 2006-07-28T05:52:59+09:00 Subject: Re: Wrapped method causing infinite recursion in rcov I don't like advertising my own work, but... > old_get=instance_method(:get) > define_method(:get) do |*args| > old_get[*args] This works, unless you want the method to receive a &block. (Though that's fixed in Ruby 1.9.) I would do this: class Module def assert_valid_markup(method_name) do post_condition(method_name) do |obj, method_name, args, block| # Check it... end end end class Foo def get(*args) # The real stuff... end assert_valid_markup :get if $DEBUG end I call this assert_valid_markup a "monitor-function" [1]. This post_condition is defined on the site as well. gegroet, Erik V. - http://www.erikveen.dds.nl/ [1] http://www.erikveen.dds.nl/monitorfunctions/index.html