[rspec-devel] rspec extensions

Brian Takita brian.takita at gmail.com
Sat Sep 15 03:20:10 EDT 2007

On 9/12/07, Nick Kallen <nick at pivotalsf.com> wrote:
> i know you're on vacation but i'd bet you're checking your email:
Not that often. Ive been able to stay away for the most part :)
I'm ccing the rspec developer list for more ideas.
> i want to add an extension to RSpec. I'd like to be able to "tag" it and
> describe statements. For example:
> it "should ensure that my checkbook is balanced", :tags => [:smoke,
> :accounting] do
> end
> describe Checkbook, "foobar", :tags => [:fast, :accounting] do
> end
> (syntax TBD)
> I then want a rake task like:
> rake spec TAGS=(fast and accounting)
> rake spec TAGS=(regression or user)
> ---
> How hard would it be to do something like this? Does Rspec have a plugin
> framework?
Thats really interesting. There has been talk about adding tagging to rspec.
I really like it. This feature would be particularly useful for mature
projects where the precheckin tests are reducing productivity by being
slow. Nick, do you have some other use cases in mind?

rspec is a moving target. The internals in svn trunk are significantly
different from the current release (1.0.8).

I think such a tagging feature would be useful in rspec core. To add
it to rspec core (trunk), I think the following objects need to be
touched (without seeing the code):
* Tagging object(s)
* Example.suite
* ExampleApi (describe, it, and tags methods)
* ExampleDefinition (tags method)
* Options (For non-rake command line arguments)
* OptionParser (For non-rake command line arguments)
* maybe SpecTask

I suspect, in your case, you only care about rake, so you would not
need to care about Options and OptionParser.

Is this something that you would like to do really soon or can you
wait for the next release?

If you want to do it before the next release, the touch points will be
a little different.

The closest thing to a plugin architure is the a configuration object.
The tags feature seems like it should be implementable by a plugin but
now requires vertical changes (across several objects). It seems there
is some work needed there.


More information about the rspec-devel mailing list