[Nitro] Nitro/OG spec convention/organization questions

Arne Brasseur arne at arnebrasseur.net
Sat Sep 1 21:00:24 EDT 2007


Mark Van De Vyver schreef:
> Hi,
> 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.
>   
Both structure and content can (IMHO) be improved upon. Before recently 
Nitro/Og used Test::Unit. There was decided (before I came here) to 
convert everything to RSpec. This conversion had been slacking for a 
long time. I implemented the rake tasks to run the specs, with the 
actual test runners taken from Ramaze. It was by no means perfect, but 
Good Enough to get things going again and put a bit more emphasis on the 
tests.

I did most of the syntax-level conversion from Test::Unit to RSpec, with 
Jo making sure the tests pass. The last time I checked there were still 
several incomplete or failing tests.
> ...
>   

> 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?
>   
...
> A directory structure might look like:
>
> ./spec
> ./spec/benchmarks
> ./spec/developer
> ./spec/examples
> ./spec/fixtures
> ./spec/models
>
> The fixtures and models dir's could be sub dir's of
>  ./spec/support/
>
> Or, should we 'just do it' and merge/cull/re-organize later? I think
> can hear some people groaning :)
>   
Actually I'm glad you bring this up. The rule of thumb I applied was to 
largely mirror the lib/<project> dir in spec, so one spec file with the 
same name and relative location for every source file. This was not 
considered stringent. This leaves the question open where to put support 
files.

My idea was to
- convert everything
- make tests go green
- improve on content and structure

However George seems to have some great plans with the specs, with the 
hidden directories and all of that, so I'm waiting to see what happens. 
He told me three weeks ago the tests would be moved back ASAP. I also 
moved to the other side of the world this week, so I haven't really 
looked at it much lately.

I hope this answers some of your questions. George, could you please let 
us in on what you have in mind regarding the tests/specs?

regards
(ab)

-- 
Arne Brasseur
http://www.arnebrasseur.net
arne at arnebrasseur.net



More information about the Nitro-general mailing list