Closed petRUShka closed 14 years ago
did you try to use autospec ?
I have no autospec bin. Because autospec was deprecated in rspec2.
can you try to narrow down the problem, e.g. find the most simple setup that does not work (empty rails project with just rspec 2 and one empty spec?)
created new rails project
source 'http://rubygems.org'
gem 'rails', '3.0.0.beta3'
gem 'sqlite3-ruby', :require => 'sqlite3'
group :test do
gem 'rspec-rails', '>=2.0.0.beta.8'
gem 'rspec', '>=2.0.0.beta.8'
gem 'autotest-rails-pure'
gem 'autotest-growl'
end
create spec/models/test_spec.rb
loading autotest/rails
style: Rails
Instead of style: Rspec2
thanks, ill try this setup :)
if i add discover.rb with rails and rspec2 i get:
loading autotest/rails_rspec2 Error loading Autotest style autotest/rails_rspec2 (no such file to load -- autotest/rails_rspec2). Aborting.
But when i just add rspec2 it works with:
loading autotest/rspec2 style: Rspec2 /home/micha/.rvm/rubies/ree-1.8.7-2010.01/bin/ruby -rrubygems /home/micha/.rvm/gems/ree-1.8.7-2010.01/gems/rspec-core-2.0.0.beta.8/bin/rspec /apps/test/rspec2test/spec/xxx_spec.rb . Finished in 0.00029 seconds 1 example, 0 failures
I try to use this setup:
$ cat autotest/discover.rb
And this:
$ cat autotest/discover.rb
Autotest.add_discovery { "rails" }
Autotest.add_discovery { "rspec2" }
Autotest.add_discovery { "rspec2" }
Same results. May be trouble with version of ruby? I see that you use REE 1.8.7, but in my setup Ruby: ruby 1.9.3dev (2010-05-08 trunk 27674) x86_64-linux
maybe:
I had no autotest-rails installed. And I uninstalled autotest-rails-pure and modified Gemfile:
group :test do
gem 'rspec-rails', '>=2.0.0.beta.8'
gem 'rspec', '>=2.0.0.beta.8'
gem 'autotest'
gem 'autotest-growl' end
But this action had no effect.
$ cat autotest/discover.rb
Autotest.add_discovery { "rspec2" }
raise 'foo'
p 'dasdsadsa'
But it, as i could see, had no effect:
[f/usr/bin/ruby-svn -I.:lib:test -rubygems -e "['test/unit', 'test/unit/test_test.rb', 'test/test_helper.rb'].each { |f| require f }" | /usr/lib/ruby/gems/svn/gems/autotest-4.2.9/bin/unit_diff -u
Loaded suite -e
Started
EEEEEEE
Finished in 0.085949 seconds.
1) Error:
tests(ActionController::TestCase):
ActiveRecord::StatementInvalid: SQLite3::SQLException: no such table: tests: DELETE FROM "tests" WHERE 1=1
2) Error:
tests(ActionDispatch::IntegrationTest):
ActiveRecord::StatementInvalid: SQLite3::SQLException: no such table: tests: DELETE FROM "tests" WHERE 1=1
3) Error:
tests(ActionView::TestCase):
ActiveRecord::StatementInvalid: SQLite3::SQLException: no such table: tests: DELETE FROM "tests" WHERE 1=1
4) Error:
tests(ActiveRecord::TestCase):
ActiveRecord::StatementInvalid: SQLite3::SQLException: no such table: tests: DELETE FROM "tests" WHERE 1=1
5) Error:
tests(ActiveSupport::TestCase):
ActiveRecord::StatementInvalid: SQLite3::SQLException: no such table: tests: DELETE FROM "tests" WHERE 1=1
6) Error:
test_the_truth(TestTest):
ActiveRecord::StatementInvalid: SQLite3::SQLException: no such table: tests: DELETE FROM "tests" WHERE 1=1
7) Error:
tests(TestTest):
ActiveRecord::StatementInvalid: SQLite3::SQLException: no such table: tests: DELETE FROM "tests" WHERE 1=1
7 tests, 0 assertions, 0 failures, 7 errors, 0 skips
Test run options: --seed 40297
Unable to map class ActionController::TestCase to a file
Unable to map class ActionDispatch::IntegrationTest to a file
Unable to map class ActionView::TestCase to a file
Unable to map class ActiveRecord::TestCase to a file
Unable to map class ActiveSupport::TestCase to a file
Unable to map class TestTest to a file
Unable to map class TestTest to a file
ahh got it, its a 1.9 problem, same at me now with 1.9.2, ill try to fix it asap :)
That's great! Sometimes I thought that it is only my bug :)
Good luck with your work!
ruby 1.9 has a great new bug feature: the current path is not in the load path...
4.2.10 is for you :)
Yahoo!!
$ autotest
loading autotest/cucumber_rails_rspec2
style: CucumberRailsRspec2
Thank you! It works!
I can't force autotest to use rspec2 tests instead of test/unit.
But rspec spec/ works fine. And autotest/discover.rb have rspec2 line:
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 autotest
autotest (4.2.9) autotest-growl (0.2.4) autotest-rails-pure (4.1.0)
Gemfile:
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
cat /home/petrushka/.autotest
require 'autotest/growl'
cat .autotest
Autotest.add_hook :initialize do |at| at.add_exception 'tmp' at.add_exception 'rerun.txt' at.add_exception 'vendor' at.add_exception '.git' end