0

我正在尝试使用我的rails项目获得自动测试,但我一直在获取不同的错误。无法自动测试在我的rails项目上工作

我的设置:

  • Windows 7操作系统
  • 我的Rails版本是3.1.3
  • 我的红宝石版本1.9.2p290
  • 我ZenTest的宝石是在4.5(也试过4.6 0.2)
  • 我MINITEST宝石是1.6.0(也试过2.10.0)

杉木我应该安装哪些宝石?

我跑进了一堆不同的自动测试宝石,并尝试了一堆不同的组合,但似乎没有任何工作。

香港专业教育学院试图

  • 创业板安装自动测试护栏(似乎是最有可能的)

而且

  • 创业板安装自动测试
  • 创业板安装自动测试,独立
  • gem install autotest-rails-pure

(来源)

我有一对夫妇不同的故障,但最常见的一种,我得到了以下

c:\RailsInstaller\Ruby1.9.2\bin\ruby -I.;lib;test -rubygems -e "['test/unit', 'test/functional/status_controller_test.rb 
', 'test/unit/helpers/status_helper_test.rb', 'test/unit/helpers/home_helper_test.rb', 'test/unit/user_test.rb', 'test/f 
unctional/home_controller_test.rb', 'test/functional/playlists_controller_test.rb', 'test/unit/playlist_test.rb', 'test/ 
functional/registrations_controller_test.rb', 'test/unit/song_test.rb', 'test/unit/helpers/about_helper_test.rb', 'test/ 
unit/helpers/playlists_helper_test.rb', 'test/functional/songs_controller_test.rb', 'test/unit/helpers/registrations_hel 
per_test.rb', 'test/unit/helpers/songs_helper_test.rb', 'test/functional/about_controller_test.rb'].each { |f| require f 
}" | ruby c:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/autotest-standalone-4.5.9/bin/unit_diff -u 

c:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/turn-0.8.3/lib/turn/autorun/minitest.rb:14:in `<top (required)>': MiniTest v1.6.0 is  out of date. (RuntimeError) 
`gem install minitest` and add `gem 'minitest' to you test helper. 

    from c:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require' 
    from c:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `block in require' 
    from c:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:225:in `load_dependency' 
    from c:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require' 
    from c:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/turn-0.8.3/lib/turn.rb:13:in `<top (required)>' 
    from c:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require' 
    from c:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `block in require' 
    from c:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:225:in `load_dependency' 
    from c:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require' 
    from c:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/test_help.rb:19:in `<top (required)>' 
    from c:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require' 
    from c:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `block in require' 
    from c:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:225:in `load_dependency' 
    from c:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require' 
    from c:/RailsProjects/songrake/test/test_helper.rb:3:in `<top (required)>' 
    from c:/RailsInstaller/Ruby1.9.2/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require' 
    from c:/RailsInstaller/Ruby1.9.2/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require' 
    from c:/RailsProjects/songrake/test/functional/status_controller_test.rb:1:in `<top (required)>' 
    from c:/RailsInstaller/Ruby1.9.2/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require' 
    from c:/RailsInstaller/Ruby1.9.2/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require' 
    from -e:1:in `block in <main>' 
    from -e:1:in `each' 
    from -e:1:in `<main>' 

我也尝试添加的gem "minitest"变化(不同的版本号),我的Gemfile。我也尝试添加一些其他的gem文件到gemfile。

反正愿意使用这个工具!谢谢您的帮助!

+0

尝试卸载'minitest'宝石,并只使用'ZenTest'(或'autotest',这是ZenTest的同义词宝石)。你现在看到什么错误? – 2011-12-30 11:11:57

+0

嘿亚历克斯,我在过去的5分钟里几乎找不到这个问题。我会尽我所能发布答案。感谢您的帮助! – hajpoj 2011-12-30 11:19:10

回答

3

多亏了这个问题,我能弄明白......

Error running autotest on Windows 7 with Rails 3, Ruby 1.9.2

所有你需要的是ZenTest创业板和自动测试 - 测试 - 纯宝石。

然后添加以下到您的gemfile

group :test do 
    gem 'ZenTest' 
    gem 'autotest-rails-pure' 
    gem 'minitest' 
end 

,而是刚刚从你需要运行"$ bundle exec autotest"


我不明白捆绑高管所做的命令行运行"$ autotest"的但继承人发现我在 http://gembundler.com/

捆绑高管

运行自带的宝石在你的包

$ bundle exec rspec spec/models 

在某些情况下,运行可执行文件,而不捆绑高管可能工作,如果可执行恰好可以安装一个可执行的系统,并没有拉入任何与你的软件包冲突的宝石。

但是,这是不可靠的,是相当大的痛苦的来源。即使它看起来有效,它可能在未来或另一台机器上都不起作用。

相关问题