grosser / autotest

Save a file, autotest will run the matching tests! (Autotest without ZenTest)
121 stars 20 forks source link

Autotest fails if test/ and spec/ folders are simultaneously in rails3 project #7

Closed petRUShka closed 14 years ago

petRUShka commented 14 years ago

If I have spec/ (with real specs) and test/ (with scaffold tests) in rails project tree I got an error:

/usr/lib/ruby/gems/svn/gems/rspec-rails-2.0.0.beta.8/lib/autotest/rails_rspec2.rb:36:in block (2 levels) in <top (required)>': undefined methodsingularize' for "companies":String (NoMethodError)
from /usr/lib/ruby/gems/svn/gems/autotest-4.2.10/lib/autotest.rb:529:in call' from /usr/lib/ruby/gems/svn/gems/autotest-4.2.10/lib/autotest.rb:529:intest_files_for'
from /usr/lib/ruby/gems/svn/gems/autotest-4.2.10/lib/autotest.rb:401:in block in find_files_to_test' from /usr/lib/ruby/gems/svn/gems/autotest-4.2.10/lib/autotest.rb:401:ineach'
from /usr/lib/ruby/gems/svn/gems/autotest-4.2.10/lib/autotest.rb:401:in map' from /usr/lib/ruby/gems/svn/gems/autotest-4.2.10/lib/autotest.rb:401:infind_files_to_test'
from /usr/lib/ruby/gems/svn/gems/autotest-4.2.10/lib/autotest.rb:256:in run_tests' from /usr/lib/ruby/gems/svn/gems/autotest-4.2.10/lib/autotest.rb:245:inget_to_green'
from /usr/lib/ruby/gems/svn/gems/cucumber-0.7.2/lib/autotest/cucumber_mixin.rb:54:in get_to_green' from /usr/lib/ruby/gems/svn/gems/cucumber-0.7.2/lib/autotest/cucumber_mixin.rb:28:inblock in run'
from /usr/lib/ruby/gems/svn/gems/cucumber-0.7.2/lib/autotest/cucumber_mixin.rb:26:in loop' from /usr/lib/ruby/gems/svn/gems/cucumber-0.7.2/lib/autotest/cucumber_mixin.rb:26:inrun'
from /usr/lib/ruby/gems/svn/gems/autotest-4.2.10/lib/autotest.rb:135:in run' from /usr/lib/ruby/gems/svn/gems/autotest-4.2.10/bin/autotest:54:in<top (required)>'
from /usr/bin/autotest:19:in load' from /usr/bin/autotest:19:in
'

But if I move test/ to test2/ all is ok.

My system settings: Arch Linux x86_64 ruby 1.9.3dev (2010-05-08 trunk 27674) x86_64-linux Rails 3.0.0.beta.3

# gem-svn list | grep rspec
rspec (2.0.0.beta.8)
rspec-core (2.0.0.beta.8)
rspec-expectations (2.0.0.beta.8)
rspec-mocks (2.0.0.beta.8)
rspec-rails (2.0.0.beta.8)

gem-svn list | grep autotest

autotest (4.2.10) autotest-growl (0.2.4) autotest-rails-pure (4.1.0)

Gemfile:

source 'http://rubygems.org'
gem 'rails', '3.0.0.beta3'
gem 'devise', '1.1.rc1'
gem 'mysql'
group :test do
gem 'database_cleaner'
gem 'rspec-rails', '>=2.0.0.beta.8'
gem 'rspec', '>=2.0.0.beta.8'

gem 'test-unit'

gem 'cucumber', '0.7.2' gem 'cucumber-rails', '0.3.1'#, :git => 'git://github.com/aslakhellesoy/cucumber-rails.git' gem 'capybara'

gem 'autotest'

gem 'autotest-rails-pure' gem 'autotest-growl' gem 'machinist' end

grosser commented 14 years ago

i think the problem lies in autotest/rails_rspec2.rb, which is maintained by the rspec guys

petRUShka commented 14 years ago

created issue in rspec2: http://github.com/rspec/rspec-rails/issues/issue/50