[rspec-users] How to write specification for the *base* class API?
lists at ruby-forum.com
Tue Jul 15 10:10:30 EDT 2008
David Chelimsky wrote:
> On Jul 15, 2008, at 8:22 AM, Piotr Wlodarek <lists at ruby-forum.com>
>> It's not AR. I have 2 levels: Site1Scraper < BaseScraper.
>> There will be many SiteXScrapers implemented by several people.
>>> From your answers I conclude it's not possible (or at least not
>> recommended) to document abstract interface with RSpec.
> If everyone gave up that easily we'd never improve anything ;)
> Not sure how you get to "not possible." Pat suggested shared examples,
> which would be a perfectly good solution for part of the problem.
> I think the question is what are you trying to acheive here and
> whether Rspec (or any testing framework) is the right place for that
I try to document public API of important base class.
Shared examples, as you said, solve part of the problem.
Since I try to develop this project in a BDD style, and specifications
are said to be - among other things - a documentation tool, it seems
reasonable to take advantage of it. Alternative is mixed documentation
of rdoc + specs.
In a perfect world I would expect to have only one documentation tool:
Posted via http://www.ruby-forum.com/.
More information about the rspec-users