[rspec-users] How to write specification for the *base* class API?

Pat Maddox pergesu at gmail.com
Tue Jul 15 08:47:56 EDT 2008

On Tue, Jul 15, 2008 at 5:17 AM, Piotr Wlodarek <lists at ruby-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.

> 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.


More information about the rspec-users mailing list