[rspec-users] Reason for _spec.rb convention

David Chelimsky dchelimsky at gmail.com
Mon Sep 3 10:14:58 EDT 2007


On 9/3/07, Pat Maddox <pergesu at gmail.com> wrote:
> On 9/3/07, David Chelimsky <dchelimsky at gmail.com> wrote:
> > On 9/3/07, Ashley Moran <work at ashleymoran.me.uk> wrote:
> > > Hi
> > >
> > > Easy one - I just wondered why all spec files for rspec_on_rails end
> > > "_spec.rb" instead of just ".rb"?  They are all inside the spec
> > > folder so surely the fact they are specs is implicit?
> >
> > For me, personally, if I'm in TextMate and I see a row of tabs that say:
> >
> > thing.rb|thing_controller.rb|thing_controller.rb|thing.rb
> >
> > I'm going to be confused by that. It also makes searching for the file
> > that much more complicated because you have to start looking for the
> > folder when you search for thing.rb instead of just looking for the
> > filename.
> >
> > Thoughts about that?
>
> >From a practical standpoint, _spec is there because it allows me to
> distinguish files at a glance.
>
> >From a philosophical standpoint, .rb is there because I'm writing
> specifications that just happen to be implemented in Ruby.  (no I
> would not suggest in a million years that the files be changed to
> .spec.  That's silly)

Can't tell if you're being serious or sarcastic here. Is it really
silly? If so, why? Maybe you're on to something here.

>
> Pat
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>


More information about the rspec-users mailing list