On Oct 20, 2007, at 4:29 PM, David C. wrote:
opposing forces and making a practical decision.
Perhaps there are solutions for specific libraries - e.g.
ActiveRecord, but even then you’re going to have to specify structure
in advance (has_many vs has_many through) and consequently change your
specs when you decide to change your model.
Sure - I’m only advocating a solution to AR, not a more a general
one. How many other (ruby) apps are built on top of a giant DSL?
A has_many call is a macro - it generates 9 methods. I don’t see a
big problem with changing it in one place. It’s a much bigger deal
if you have to change the custom stubs you’ve created for that one
macro is 9 specs.
These common patterns (for Rails) should be abstracted away
(as some have been doing with Rails’ association proxy). There is no
reason that all of those implementation details of another library
need to be crowding the intention of my specs. Until this happens, I
need to know all of these details about how another library works,
which, for me, is too far off the scale (no balance there)…We’re all looking forward to your matcher libraries
Not going to happen soon, because I don’t care to dig into the
internals of ActiveRecord. Maybe if I get really frustrate, it will
happen, but for now I’m hoping someone else in the community with
more AR experience will come up with something like this.
Scott
