[rspec-users] ZenTest autotest now handles RSpec, yay!

Matt Aimonetti matttemp at gmail.com
Tue Apr 17 19:55:58 EDT 2007


Nick, maybe you can help. I modified the tests_for_file function in
rspecrails_autotest.rb and I simply added

  def tests_for_file(filename)
    case filename
    when %r%^spec/fixtures/(.*)s.yml% then
      ["spec/models/#{$1}_spec.rb",
       "spec/controllers/#{$1}_controller_spec.rb"]
    when %r%^spec/models/.*rb$% then
      [filename]
    when %r%^spec/controllers/.*\.rb$% then
      [filename]
    when %r%^spec/views/([^/]*)/.*\.rb$% then
      [filename]
    # when %r%^spec/acceptance/.*\.rb$% then
    #   [filename]

It now loads all my view specs, what should I do to get that added to the
next release of autotest for RSpec?

Matt

P.s: I wish there was a hook to add more files to test such as my plugin
specs ;)


On 4/17/07, Matt Aimonetti <matttemp at gmail.com> wrote:
>
> Thanks, but I still have the issue of adding my plugin to be scanned by
> autotest. (Nick, is there anyway we could add more files to be scanned?)
>
> The other issue I'm facing is that my view specs are not checked by
> autotest. My view specs are in /spec/views/[controller
> name]/[view_name]_spec.rb
>
> I understand this is not related directly to RSpec but is you use RSpec
> and you want to use AutoTest you will face the same issue.
>
> Thanks,
>
> Matt
>
>
> On 4/17/07, Nick Sieger <nicksieger at gmail.com> wrote:
> >
> > On 4/17/07, Marcus Ahnve <marcus at ahnve.com> wrote:
> > > On 4/13/07, Matt Aimonetti <matttemp at gmail.com> wrote:
> > > >
> > > > Josh Knowles http://joshknowles.com/ just let me know that ZenTest
> > Autotest
> > > > 3.50 now handles your RSpec specs.
> > >
> > > It seems that autotest assumes you are using integrated views specs.
> > >
> > > I've changed my rspec_rails_autotest.rb accordingly to run view specs
> > > automatically:
> > >
> > >     # when %r%^app/views/layouts/(.*)\.rhtml% then
> > >     #   ["spec/views/layouts/#{$1}_spec.rb"]
> > >     when %r%^app/views/(.*)\.rhtml$% then
> > >       ["spec/views/#{$1}_view_spec.rb"]
> > >
> >
> > Yeah, this is reasonable -- when I first wrote the code I more or less
> > ported the autotest for Rails, before RSpec had standalone view
> > testing.  It's not clear to me right now how to allow rspec/autotest
> > to be customized depending on whether you do standalone or integrated
> > views, to ensure that the right specs get run, other than to make the
> > change you make here.
> >
> > /Nick
> > _______________________________________________
> > rspec-users mailing list
> > rspec-users at rubyforge.org
> > http://rubyforge.org/mailman/listinfo/rspec-users
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rspec-users/attachments/20070417/3feae0c6/attachment.html 


More information about the rspec-users mailing list