[Nitro] Nitro/OG spec convention/organization questions

Mark Van De Vyver mvyver at gmail.com
Sat Sep 1 20:29:11 EDT 2007

I've questions about spec best practice and organization of specs in
nitro/og.  Please don't consider any of this critical - I'm just
talking about superficial issues, not the content of the current
written spec files.

I'd appreciate any thoughts on what is considered best practice in the
RSpec/spec world.

My understanding is that specs _can_ be a form of documentation and a
source of 'howto' hints for users - maybe even point them to
convenience/performance ways of doing things (if not best practice) -
this is probably more important while these projects are being
developed and before all the books are written ;)
This makes me think we should maybe consider a directory structure:

A 'spec' of classes and methods a user is 'expected' to encounter
should be in the first level, others should be in the second. In some
sense a split that is a hassel, but maybe the user level specs will be
quite stable relative to the developer specs, so One would still be
spending most time in one folder?

Next, should spec files correspond to the file name containing the
code they spec, or the class/module name?  If you think the file name,
then what should be done with directory structures? Or should there be
no such ties that bind?
The issue here is how do the unitiated/stale work out from the spec
just where the code resides (the ideal solution will also permit one
to work out from the code where the spec is/should be)

Related to the last issue: should file naming be <...>_spec.rb, or
without the _spec extension?

Finally, if anyone specs an example or a benchmark should these be in
separate directories?

A directory structure might look like:


The fixtures and models dir's could be sub dir's of

Or, should we 'just do it' and merge/cull/re-organize later? I think
can hear some people groaning :)


More information about the Nitro-general mailing list