[rspec-users] Something like tags in cucumber

Phillip Koebbe phillipkoebbe at gmail.com
Mon Jan 18 10:06:07 EST 2010


In cucumber, I use tags in a very simple, yet helpful (to me) way: to 
number my scenarios. For example:

@1

Scenario: This is a scenario

@2

Scenario: This is another scenario

@3

Scenario: You get the idea

This allows me to focus in on a single scenario quite easily while I'm 
working on it. Once I have that scenario working correctly, I will run 
the entire feature to make sure nothing else is broken.

I'm finding that I'd like to do something quite similar in RSpec. For 
example, when I'm working on a model spec, I generally have contexts for 
what database fields should exist, what validations should exist, and 
what associations should exist. When I am later adding a couple of 
custom methods to do something, I'd like to be able to run the spec just 
for what I'm presently working on. Is this possible?

Peace,
Phillip


More information about the rspec-users mailing list