gpt4 book ai didi

ruby-on-rails-3 - 如何调试 rake 规范不执行测试;无限悬挂问题(rails 3)

转载 作者:行者123 更新时间:2023-12-03 00:32:43 25 4
gpt4 key购买 nike

使用 rake 0.9.2、rspec、期望、mocks 2.6.0、rspec-core 2.6.4、rspec-rails 2.6.1

当我执行 rakerails 或 rspecspecpath/to/spec 时,我会得到正常的输出,直到我期望看到测试实际执行,然后就没有进一步的了。我必须终止进程kill-9 %1 才能终止任务。

我的 gem 文件:

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

外壳输出:

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,尽管我没有任何直接相关性的具体证据。感谢您提供有关如何更好地调试此问题的任何建议。

最佳答案

呃,事实证明这是其中一个灯具文件的问题。我不使用它们,通常是工厂和 stub ,并且有一个规范不完整,所以看起来 rspec 只是卡在上面。我通过缩小命令范围来测试不同的组来解决这个问题,比如“rakespec:models”,它有效,然后“rakespec:controllers”挂起。查看生成的规范并注意到加载灯具的线路,将其移除,瞧。永远不会沉闷...;-)

关于ruby-on-rails-3 - 如何调试 rake 规范不执行测试;无限悬挂问题(rails 3),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6333532/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com