[Rspec-devel] define_instance_method, stub_with, and mock_with
dastels at daveastels.com
Mon Sep 4 21:08:57 EDT 2006
-----BEGIN PGP SIGNED MESSAGE-----
On 4-Sep-06, at 9:37 PM, Jay Levitt wrote:
> David Astels wrote:
>> On 4-Sep-06, at 8:49 PM, David Astels wrote:
>>> I will be looking hard at mocha/stubba tonight, but they look like a
>>> good way to go. I'm quite happy to have us depricate rSpec's mock
>>> framework in favour of mocha/stubba.
>> Well.. on first glance Mocha seems significantly inferior to rSpec
>> mocks. No support for consecutive calls, primitive argument
>> matching, no ordering, and a rather clunky syntax.
> Is that inherent to Mocha's structure, though, or just a function
> of the
> fact that Mocha's all of 45 days old? I wonder if contributing these
> features to Mocha isn't better than creating a
> pluggable-framework-framework. In fact, I think I can argue that in
> either case:
Probably. Both mocha and rspec-mock are built partly on the same
base (Schmock)... it should be easy to add these capabilities to Mocha.
> If these features are inherent to the mock object, then there's no
> way a
> pluggable framework could support such verifications on Mocha objects.
> If, however, they're inherent to the verification layer, then
> there's no
> reason they can't be contributed to Mocha, thus getting rspec out
> of the
> mock business.
Verification is internal to the mock and it's expectations. The call
to verify the mock is exposed to the outer framework (test/unit or
Either way is fine with me. I do wonder what's better for the
community... a single, common mock framework... or some selection/
I generally tend to favour the latter.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (Darwin)
-----END PGP SIGNATURE-----
More information about the Rspec-devel