[rspec-users] Stories location

Wincent Colaiuta win at wincent.com
Mon Oct 15 10:21:23 EDT 2007

El 15/10/2007, a las 14:21, "David Chelimsky" <dchelimsky at gmail.com>  

> On 10/15/07, Steve <vertebrate at gmail.com> wrote:
>> Should the stories dir be located on the project root? I was  
>> expecting to
>> find it located under spec/ but there isn't anything there, just the
>> stories dir off of /.
> We want stories and specs to be parallel as they are not intended to
> be run together (they serve very different purposes). We talked about
> doing this:
> behaviour/examples
> behaviour/stories
> The problem with that approach is this:
> behaviour/examples/views/people/index.html.erb_spec.rb
> Just a bit too long for our taste. So we decided to keep things at the
> project root.

I actually quite like that proposal, despite the length, because it  
groups together all the RSpec stuff in one place, while still  
maintaining a separation between the two main parts (the specs and  
the stories).

But I do think "behaviour/specs" is a better choice than "behaviour/ 
examples" because "specs" seems to have more currency out there; I  
think "specs" is much more closely related with RSpec in people's  
minds than "examples". Say "specs" and people think "RSpec", but say  
"examples" and they could think any number of things.

One alternative: "rspec/examples" (or "rspec/specs") and "rspec/ 
stories". Saves about 4 characters if you're worried about length,  
and also provides some "advertising" for RSpec. I remember when I  
first started using RSpec it struck me as odd that the specs were  
stored in a folder called "spec" rather than "rspec" or "specs".

> Seeing as stories go in ROOT/stories, perhaps specs should go in
> ROOT/specs instead of ROOT/spec.

Well, you could make that change, but it's probably not all that  
important. I certainly wouldn't oppose it.


More information about the rspec-users mailing list