如何调试不执行测试的rake规范;无限悬挂问题(导轨3)

| 使用rake 0.9.2,rspec,期望,模拟2.6.0,rspec-core 2.6.4,rspec-rails 2.6.1 当我执行rake rails或rspec spec path / to / spec时,我得到了正常的输出,直到我希望看到测试实际执行,然后再进一步。我必须终止进程kill-9%1才能终止任务。 我的gemfile:
source \'http://rubygems.org\'

gem \'rails\', \'3.0.4\'
gem \'rake\', \'0.9.2\'

# Bundle edge Rails instead:
# gem \'rails\', :git => \'git://github.com/rails/rails.git\'

# gem \'sqlite3-ruby\', :require => \'sqlite3\'
gem \'warden\'
gem \'devise\', \"= 1.2.1\"
gem \'devise_invitable\'
gem \'mysql\'
gem \'will_paginate\', \"~> 3.0.pre2\"
gem \'acts-as-taggable-on\'
gem \'acts_as_list\'
gem \'activemerchant\'
gem \'braintree\'
gem \'bartt-ssl_requirement\', :require => \'ssl_requirement\'
gem \"paperclip\"
gem \'jeditable-rails\'
gem \'rdiscount\'
gem \"nifty-generators\", :group => :development

gem \"exception_notification\", :git => \"git://github.com/rails/exception_notification\", :require => \'exception_notifier\'

# Deploy with Capistrano
gem \'capistrano\'
gem \'capistrano-ext\'



# Bundle gems for the local environment. Make sure to
# put test-only gems in this group so their generators
# and rake tasks are available in development mode:
group :development, :test do
  gem \'webrat\', \">=0.7.2\"
  gem \"rspec-rails\"
  gem \"ZenTest\"
  #gem \"autotest\"
  #gem \"autotest-rails\"
  gem \"cucumber\",         :git => \"git://github.com/cucumber/cucumber.git\"
  gem \"database_cleaner\", :git => \'git://github.com/bmabey/database_cleaner.git\'
  gem \"cucumber-rails\", \">= 0.3.2\",   :git => \"git://github.com/cucumber/cucumber-rails.git\"
  gem \'factory_girl_rails\'
  gem \"capybara\"
  #gem \"capybara-envjs\"
  gem \"launchy\"
  gem \"spork\"
  #gem \"ruby-debug\"
  gem \"cancan\"
end
Shell的输出:
bill$ rake spec
/Users/bill/.rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.0/lib/bundler.rb:197: warning: Insecure world writable dir /opt in PATH, mode 040777
/Users/bill/.rvm/rubies/ruby-1.9.2-head/bin/ruby -S bundle exec rspec ./spec/controllers/products_controller_spec.rb ./spec/controllers/roles_controller_spec.rb ./spec/controllers/users_controller_spec.rb ./spec/models/product_spec.rb ./spec/models/role_spec.rb ./spec/models/user_spec.rb
/Users/bill/.rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.0/lib/bundler.rb:197: warning: Insecure world writable dir /opt in PATH, mode 040777
/Users/bill/.rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.0/lib/bundler.rb:197: warning: Insecure world writable dir /opt in PATH, mode 040777
然后,直到我杀死了,一切都没有。使用--trace运行不会提供任何其他信息。我确定我必须做一些简单的事情。这似乎是从我最近使用rake版本遇到的问题开始的,因此升级到rake 0.9.2,尽管我没有任何直接相关性的具体证据。感谢您提供有关如何更好地进行调试的建议。     
已邀请:
        gh,事实证明,其中一个装置文件存在问题。我不使用它们,通常是工厂和存根,并且其中有一个规范不完整,因此看起来rspec只是挂在上面。我通过缩小命令来测试不同的组来弄清楚了,例如\'rake spec:models \'起作用,然后\'rake spec:controllers \'挂起。进入生成的规格,并注意到加载灯具的线,将其移除并瞧瞧。永远不要沉闷... ;-)     
        更新:我从这个问题中找到了解决该问题的永久解决方案。我将下面的行添加到我的
config/environments/test.rb
中。
config.active_record.maintain_test_schema = false
我遇到了同样的问题。一时兴起,我决定去
rake db:test:prepare
,这似乎对我来说至少是暂时解决了这个问题。运行该命令后,我可以再次运行
rake
,而不会发生任何事件,但是如果再次运行它,则会遇到与以前相同的问题。我现在似乎陷入了这种循环。本文帮助您阐明了这个问题,但我仍然不知道如何永久解决该问题。     
        对我来说,它在更新架构后已修复:
bundle exec rake db:migrate
然后运行以下命令:
bundle exec rake db:schema:load
手动检查schema.rb文件是否已更新。     

要回复问题请先登录注册