On 15-jul-2008, at 14:47, Pat Maddox wrote:
On Tue, Jul 15, 2008 at 5:17 AM, Piotr Wlodarek <[EMAIL PROTECTED]
forum.com> wrote:
For the base class, it seems reasonable to specify public API with
RSpec.
However, since we deal with a base class, methods are often empty
(put
there just to show the API).
What's the point of that? This isn't Java.
Exactly. In all of my projects, I only have an inheritance tree of at
most 3 levels deep. AR::Base -> Generic -> Specific model.
If there are more than three levels, something might not be okay with
the design of your app. Of course your mileage may vary, but I think
a lot of developers will agree on this subject.
The spec cannot be run against the base class. In consequence, the
spec
must be duplicated in every derived class, which seems to be far from
DRY.
Presumably the derived classes have different implementations, so you
would need to spec them out differently.
If the implementations are the same, shared behaviors are often
useful.
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users