floehopper/mocha — pull request #70 by viking (2012-02-28 22:40:35+00:00)
Title: Rename Mock#expectations to Mock#__expectations__ to avoid conflicts

I have a project that has a legitimate instance method named "expectations" that I would like to stub, which seems impossible with Mocha's current setup. Since Mock#expectations is an internal Mocha method, to me it seems like a good idea to use an internal name in order to avoid conflicts.

`Mock#stubs` and `Mock#expects` are already protected against masking by aliasing `Mock#__stubs__` and `Mock#__expects__`, so I used the same naming style. Since it seems rare that a user would call `Mock#expectations` directly, I just renamed the getter to `Mock#__expectations__` instead of aliasing it.

Thoughts?

Thanks,
viking