padraic/mockery — pull request #128 by jenswiese (2013-02-14 09:14:18+00:00)
Title: Adapted adding of default expectation to LIFO

Hi Pádraic,

first of all, thank you for a great mock framework. I introduced it recently in our project, and we didn't regret that step - it's a pleasure to work with.

And Mockery gave us the ability to declare default expectations, which is a major improvement for us. Unfortunately it is not possible to override a default expectation, probably on purpose. ;) But in our case it would be great to do so.

My PR concerns the way an expectation is declared byDefault(). The current behaviour is that you write all default expectations to an array, and retrieve it by traversing the array and return the first match for certain expectation. I simply switched the way of adding expectation to that array, so that you actually will always retrieve the last expectation.

When this is not a drawback of some kind, and does not harm the whole framework, I would appreciate it much, when you consider to merge this PR.

Thank you, Jens.