On Sun, May 24, 2009 at 2:25 PM, Fernando Perez <li...@ruby-forum.com> wrote: >> In the meantime I have used alias_method_chain to override the method >> in the super class. > I up this old post, but I was having the same problem mocking super() so > I had to alias_method_chain my method.
You can't mock super because super doesn't behave like other methods. It is a language keyword that invokes the same method on the parent class. So if you do this: def foo super end ... the call to super calls foo on the superclass. Since we don't get into the class hierarchy in rspec's mock/stub framework, there is no facility for managing this. I believe that is the case for mocha, flexmock and rr as well, though I could be wrong. HTH, David _______________________________________________ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users