加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

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

发布时间:2020-12-17 03:52:42 所属栏目:百科 来源:网络整理
导读:使用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
使用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,虽然我没有任何直接相关的具体证据.感谢您提供有关如何更好地调试此问题的建议.

解决方法

呃,原来这是一个灯具文件的问题.我不使用它们,通常是工厂和存根,并且有一个规格不完整,所以看起来像rspec只是挂在那上面.我想通过缩小命令来测试不同的组,比如’rake spec:models’,哪个有效,然后’rake spec:controllers’挂了.进入生成的规格并注意到加载灯具的线条,将它们移除并瞧瞧.永远不会沉闷…

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读