search for: my_instance_method

Displaying 1 result from an estimated 1 matches for "my_instance_method".

2006 Dec 21
3
Stubbing an instance method on a class
Hi all, I''m not sure if I''ve missed it, but I couldn''t find any docs for stubbing an instance method on a class. For example: class Foo; end Foo.stub!(:my_instance_method).and_return(nil) The reason (I think) I need this is because a certain class (Test::Unit::TestCase) expects an argument (name of method) to new and throws an exception if that instance method doesn''t exist. Thanks, Brian