title: how do I get a groovy MockFor/StubFor ignore method to use a demand method
body: <p>Below is the behavior I am seeking. I want a Groovy <a href="http://groovy.codehaus.org/gapi/groovy/mock/interceptor/MockFor.html#ignore%28java.lang.Object,%20groovy.lang.Closure%29">MockFor ignore method</a> to call a demand method, instead of the ignore method calling the <code>dontIgnoreMe()</code> method directly.  </p>
  
  <p>Essentially, I want to replace <code>dontIgnoreMe()</code> me with a mock, and have <code>ignoreMe()</code> call the mock (which I have done with metaClass)  It appears like categories might be a better solution. I'll look into that next week, see: <a href="http://groovy.329449.n5.nabble.com/metaclass-how-to-replace-and-restore-a-method-tt5042834.html#none">groovy nabble feed</a></p>
  
  <pre><code>import groovy.mock.interceptor.MockFor
  
  class Ignorable {
      def dontIgnoreMe() { 'baz' }
      def ignoreMe() { dontIgnoreMe() }
  }
  
  def mock = new MockFor(Ignorable)
  mock.ignore('ignoreMe')
  mock.demand.dontIgnoreMe { 'hey' }
  
  mock.use {
      def p = new Ignorable()
      assert p.dontIgnoreMe() == 'hey'
      assert p.ignoreMe() == 'hey'
  }
  </code></pre>
  
  <hr>
  
  <pre><code>Assertion failed: 
  
  assert p.ignoreMe() == 'hey'
         | |          |
         | baz        false
         Ignorable@6879c0f4
  </code></pre>