[rspec-users] foo_spec.rb -> foo.rspec (proposed RSpec file name convention)
rob at muhlestein.net
Wed Jan 10 15:44:53 EST 2007
On Wed, 2007-01-10 at 11:26 -0800, Shane Duan wrote:
> On 1/10/07, Pat Maddox <pergesu at gmail.com> wrote:
> > On 1/10/07, Rob Muhlestein <rob at muhlestein.net> wrote:
> > > Is it too late to suggest some filename conventions for example rspec
> > > files--especially when bundling with gems?
> > >
> > > I see spec_foo.rb and foo_spec.rb around. Also found some foo_ex.rb
> > > around. Would having a foo.rspec be worth talking about? Or is the
> > > convention more or less to have 'spec' in the file name?
> > I like foo_spec.rb
> [... corrected top-posting ...]
> The history from the Java world has shown that there will never be one
> standard. People choose different naming for different preferences.
> I even have 'tc_' prefix in the project because I never bothered the
> trouble after I converted them from ruby unit.
Agreed, but convention is different than standard. Perl users starting
using .t for their test scripts and it stuck.
After a full reread of the http://rspec.rubyforge.org site (a good one I
might add) it is very clear the intent is to use foo_spec.rb and from
under the 'spec/' directory in rails. It makes sense, then, that for
gems these should go in 'spec/' next to 'lib/' for example although I'm
sure we'll find specs in 'test/' for many years to come.
I'll go ahead and submit a patch to ruby-vim adding the rspec DSL tags
(context, setup, etc). Is there even one other vim user on this list
that understands my point?
More information about the rspec-users