How to stub out Rails helper methods with Mocha?

UPDATE The code given doesn't actually work. I'd love to hear if anyone knows of code that will do this. I hacked around the problem a very ugly way.

Rails helper methods are defined in modules and mixed into objects...of what class? Turns out it's anonymous copies of ActionView::Base. How does one mock or stub methods on such a beast? Here's a solution I found:

class MyController
def rescue_action(e) raise e end
attr_reader :template

class MyControllerTest < Test::Unit::TestCase
def setup
@controller = ...

def test_should_stub_helper_method

Thanks to Matthew Dieter for posting about this. I had to add the attr_reader line to get this to work.