Is the rspec_autotest plugin mentioned here, http://blog.nicksieger.com/articles/2006/11/15/rspec-autotest-now-a-rails-plugin the accepted method of auto testing specs? It''s an old article, and after grabbing the plugin, and giving it a run, it fails with: $ rake spec:autotest:rails trunk/vendor/plugins/rspec_on_rails/lib/spec/rails/dsl/behaviour/rails_example.rb:31: undefined method `before'' for Spec::Rails::DSL::RailsExample:Class (NoMethodError) from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'' from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'' from trunk/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:496:in `require'' from trunk/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:342:in `new_constants_in'' from trunk/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:496:in `require'' from trunk/vendor/plugins/rspec_on_rails/lib/spec/rails/dsl/behaviour.rb:2 from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'' from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'' ... 25 levels... from /usr/lib/ruby/gems/1.8/gems/rspec-1.0.8/lib/spec/runner/command_line.rb:17:in `run'' from /usr/lib/ruby/gems/1.8/gems/rspec-1.0.8/bin/spec:3 from /usr/bin/spec:16:in `load'' from /usr/bin/spec:16 I''m currently running rspec at r2794 If there''s another method that is preferred for automatic testing, please let me know. Thanks, Steve
That''s quite outdated. RSpec now comes with it''s own autotest plugin (which should use it by default, if you have the rspec gem installed). Scott On Oct 26, 2007, at 1:23 PM, Steve wrote:> Is the rspec_autotest plugin mentioned here, > http://blog.nicksieger.com/articles/2006/11/15/rspec-autotest-now-a- > rails-plugin > the accepted method of auto testing specs? It''s an old article, and > after > grabbing the plugin, and giving it a run, it fails with: > > $ rake spec:autotest:rails > trunk/vendor/plugins/rspec_on_rails/lib/spec/rails/dsl/behaviour/ > rails_example.rb:31: undefined method `before'' for > Spec::Rails::DSL::RailsExample:Class (NoMethodError) > from /usr/local/lib/site_ruby/1.8/rubygems/ > custom_require.rb:27:in `gem_original_require'' > from /usr/local/lib/site_ruby/1.8/rubygems/ > custom_require.rb:27:in `require'' > from trunk/vendor/rails/activerecord/lib/../../ > activesupport/lib/active_support/dependencies.rb:496:in `require'' > from trunk/vendor/rails/activerecord/lib/../../ > activesupport/lib/active_support/dependencies.rb:342:in > `new_constants_in'' > from trunk/vendor/rails/activerecord/lib/../../ > activesupport/lib/active_support/dependencies.rb:496:in `require'' > from trunk/vendor/plugins/rspec_on_rails/lib/spec/rails/dsl/ > behaviour.rb:2 > from /usr/local/lib/site_ruby/1.8/rubygems/ > custom_require.rb:27:in `gem_original_require'' > from /usr/local/lib/site_ruby/1.8/rubygems/ > custom_require.rb:27:in `require'' > ... 25 levels... > from /usr/lib/ruby/gems/1.8/gems/rspec-1.0.8/lib/spec/ > runner/command_line.rb:17:in `run'' > from /usr/lib/ruby/gems/1.8/gems/rspec-1.0.8/bin/spec:3 > from /usr/bin/spec:16:in `load'' > from /usr/bin/spec:16 > > I''m currently running rspec at r2794 > > If there''s another method that is preferred for automatic testing, > please > let me know. > > Thanks, > Steve > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users
On Fri, 26 Oct 2007 13:38:09 -0400, Scott Taylor wrote:> That''s quite outdated. RSpec now comes with it''s own autotest plugin > (which should use it by default, if you have the rspec gem installed). > > ScottI''m running from trunk, and don''t have the gem installed. How is autotesting enabled? Is it a special switch passed to ''spec'' or ''spec_server''?
On 10/26/07, Steve <vertebrate at gmail.com> wrote:> > I''m running from trunk, and don''t have the gem installed. How is > autotesting enabled? Is it a special switch passed to ''spec'' or > ''spec_server''?gem install ZenTest cd RAILS_ROOT autotest
On Fri, 26 Oct 2007 18:51:17 +0000, Steve wrote:> On Fri, 26 Oct 2007 13:38:09 -0400, Scott Taylor wrote: > >> That''s quite outdated. RSpec now comes with it''s own autotest plugin >> (which should use it by default, if you have the rspec gem installed). >> >> Scott > > I''m running from trunk, and don''t have the gem installed. How is > autotesting enabled? Is it a special switch passed to ''spec'' or > ''spec_server''?Actually I take that back, apparently once upon a time I did install the rspec gem v1.0.8. Where would one find the necessary autotest capabilities?
On Oct 26, 2007, at 2:51 PM, Steve wrote:> On Fri, 26 Oct 2007 13:38:09 -0400, Scott Taylor wrote: > >> That''s quite outdated. RSpec now comes with it''s own autotest plugin >> (which should use it by default, if you have the rspec gem >> installed). >> >> Scott > > I''m running from trunk, and don''t have the gem installed. How is > autotesting enabled? Is it a special switch passed to ''spec'' or > ''spec_server''?Autotest looks at the load path when it starts up, and then looks in each load path for a file named lib/autotest/discovery.rb. Autotest requires rubygems, which by default puts any gems in the loadpath. So it goes through, and finds that rspec has this discovery.rb, and applies it if makes sense for your project (that is, if the spec/ directory exists in your project root). With this knowledge, if you really didn''t want to install the gem, you could add RAILS_ROOT/discovery.rb to require the discover.rb in RAILS_ROOT/vendor/plugins/rspec/lib/autotest/discover.rb - but my guess it that''s a bit much. The simple answer, if you just want to get it to work, is to install the gem. Scott
On Fri, 26 Oct 2007 15:01:30 -0400, Josh Knowles wrote:> On 10/26/07, Steve <vertebrate at gmail.com> wrote: >> >> I''m running from trunk, and don''t have the gem installed. How is >> autotesting enabled? Is it a special switch passed to ''spec'' or >> ''spec_server''? > > gem install ZenTest > cd RAILS_ROOT > autotestCool. I already had zentest(I think for rspec_autotest), so just running autotest seems to do the trick. One question maybe you can answer. When it starts it runs all tests, which is cool. Then if I go and make a spec that fails, it tests it which is good. If I then fix that spec, it runs the spec, and when done then goes and runs all of the files again after that which is kind of annoying(and time consuming). Is there any way to disable that? The help options are rather sparse. Thanks, Steve
On 10/26/07, Steve <vertebrate at gmail.com> wrote:> On Fri, 26 Oct 2007 15:01:30 -0400, Josh Knowles wrote: > > > On 10/26/07, Steve <vertebrate at gmail.com> wrote: > >> > >> I''m running from trunk, and don''t have the gem installed. How is > >> autotesting enabled? Is it a special switch passed to ''spec'' or > >> ''spec_server''? > > > > gem install ZenTest > > cd RAILS_ROOT > > autotest > > Cool. I already had zentest(I think for rspec_autotest), so just running > autotest seems to do the trick. One question maybe you can answer. When it > starts it runs all tests, which is cool. Then if I go and make a spec that > fails, it tests it which is good. If I then fix that spec, it > runs the spec, and when done then goes and runs all of the files again > after that which is kind of annoying(and time consuming). Is there any way > to disable that? The help options are rather sparse.That''s how autotest works. That''s the whole point of autotest. It keeps you focused on the granular problem until you fix it and then makes sure you didn''t break anything anywhere else in the process. I don''t think you can change that, but check the autotest docs. If they don''t tell you what you need, file a feature request for that project. David