我正在尝试使用 RubyMine 在现有项目中运行测试。不幸的是,每当我尝试这样做时,我都会收到未找到测试的消息,并且测试控制台输出的底部会看到以下消息:
运行 test:units 和 test:functionals 时出错! 空的测试套件。 进程以退出代码 1 结束
我已经尝试使用和不使用命令运行测试,
-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)
但除此之外没有调整默认测试配置。以下是当前配置作为参考:
RubyMine 中测试控制台的完整转储:
C:\Ruby187\bin\ruby.exe -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) C:\Ruby187\bin/rake 测试 测试于下午 1:41 开始... (在 C:/CodeMetrics/2nd/cmusv 中) C:/Ruby187/bin/ruby.exe -I"lib;test" "C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb ” “test/unit/course_number_test.rb” “test/unit/course_test.rb” “test/unit/curriculum_comment_test.rb” “test/unit/curriculum_comment_type_test.rb” “test/unit/effort_log_line_item_test.rb” “test/unit /effort_log_mailer_test.rb" "test/unit/effort_log_template_test.rb" "test/unit/effort_log_test.rb" "test/unit/google_apps_test.rb" "test/unit/page_test.rb" "test/unit/paper_test.rb" “test/unit/person_test.rb” “test/unit/project_test.rb” “test/unit/project_type_test.rb” “test/unit/rss_feed_test.rb” “test/unit/scotty_dog_saying_test.rb” “test/unit/task_type_test.rb" "test/unit/team_test.rb" "test/unit/time_machine_test.rb" "test/unit/user_test.rb" C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rails-2.3.4/lib/rails/gem_dependency.rb:119:Warning: Gem::Dependency#version_requirements 已弃用,将在或 2010 年 8 月之后。使用#requirement C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:440:in `load_missing_constant': 未初始化常量 Test::Unit::UI: :SILENT (名称错误) 来自 C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:80:in `rake_original_const_missing' 来自 C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2503:in `const_missing' 来自 C:/Ruby187/lib/ruby/gems/1.8/gems/test-unit-1.2.3/lib/test/unit/autorunner.rb:47 来自 C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in `require' 来自 C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in `require' 来自 C:\Program Files (x86)\JetBrains\RubyMine 97.39/rb/testing\patch\testunit/test/unit/autorunner.rb:24 来自 C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in `require' 来自 C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in `require' 来自 C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/test-unit-2.1.1/lib/test/unit.rb:2 来自 C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in `require' 来自 C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in `require' 来自 C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/should-2.11.3/lib/shoulda/integrations/test_unit.rb:1 来自 C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in `require' 来自 C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in `require' 来自 C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/should-2.11.3/lib/should.rb:8 来自 C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:64:in `require' 来自 C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:64:in `require' 来自 C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:62:in `each' 来自 C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:62:in `require' 来自 C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:51:in `each' 来自 C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:51:in `require' 来自 C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler.rb:112:in `require' 来自 C:/CodeMetrics/2nd/cmusv/config/boot.rb:43:in `load_gems' 来自 C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rails-2.3.4/lib/initializer.rb:164:in `process' 来自 C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rails-2.3.4/lib/initializer.rb:113:in `send' 来自 C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rails-2.3.4/lib/initializer.rb:113:in `run' 来自 C:/CodeMetrics/2nd/cmusv/config/environment.rb:17 来自 ./test/test_helper.rb:2:in `require' 来自 ./test/test_helper.rb:2 来自 ./test/unit/course_number_test.rb:1:in `require' 来自 ./test/unit/course_number_test.rb:1 来自 C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in `load' 来自 C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5 来自 C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in `each' 来自 C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5 C:/Ruby187/bin/ruby.exe -I"lib;test" "C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb ” “test/functional/courses_controller_test.rb” “test/functional/course_numbers_controller_test.rb” “test/functional/curriculum_comments_controller_test.rb” “test/functional/curriculum_comment_types_controller_test.rb” “test/functional/effort_logs_controller_test.rb” “test/functional /effort_log_line_items_controller_test.rb" "test/functional/effort_reports_controller_test.rb" "test/functional/mailing_lists_controller_test.rb" "test/functional/pages_controller_test.rb" "test/functional/papers_controller_test.rb" "test/functional/people_controller_test.rb" "test/functional/projects_controller_test.rb" "test/functional/project_types_controller_test.rb" "test/functional/rss_feeds_controller_test.rb" "test/functional/scotty_dog_sayings_controller_test.rb" "test/functional/sessions_controller_test.rb" "test/functional/system_controller_test .rb" "test/functional/task_types_controller_test.rb" "test/functional/teams_controller_test.rb" "test/functional/users_controller_test.rb" "test/functional/welcome_controller_test.rb"测试/功能/system_controller_test.rb" "test/functional/task_types_controller_test.rb" "test/functional/teams_controller_test.rb" "test/functional/users_controller_test.rb" "test/functional/welcome_controller_test.rb"测试/功能/system_controller_test.rb" "test/functional/task_types_controller_test.rb" "test/functional/teams_controller_test.rb" "test/functional/users_controller_test.rb" "test/functional/welcome_controller_test.rb" C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rails-2.3.4/lib/rails/gem_dependency.rb:119:Warning: Gem::Dependency#version_requirements 已弃用,将在或 2010 年 8 月之后。使用#requirement C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:440:in `load_missing_constant': 未初始化常量 Test::Unit::UI: :SILENT (名称错误) 来自 C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:80:in `rake_original_const_missing' 来自 C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2503:in `const_missing' 来自 C:/Ruby187/lib/ruby/gems/1.8/gems/test-unit-1.2.3/lib/test/unit/autorunner.rb:47 来自 C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in `require' 来自 C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in `require' 来自 C:\Program Files (x86)\JetBrains\RubyMine 97.39/rb/testing\patch\testunit/test/unit/autorunner.rb:24 来自 C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in `require' 来自 C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in `require' 来自 C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/test-unit-2.1.1/lib/test/unit.rb:2 来自 C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in `require' 来自 C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in `require' 来自 C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/should-2.11.3/lib/shoulda/integrations/test_unit.rb:1 来自 C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in `require' 来自 C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in `require' 来自 C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/should-2.11.3/lib/should.rb:8 来自 C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:64:in `require' 来自 C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:64:in `require' 来自 C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:62:in `each' 来自 C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:62:in `require' 来自 C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:51:in `each' 来自 C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:51:in `require' 来自 C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler.rb:112:in `require' 来自 C:/CodeMetrics/2nd/cmusv/config/boot.rb:43:in `load_gems' 来自 C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rails-2.3.4/lib/initializer.rb:164:in `process' 来自 C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rails-2.3.4/lib/initializer.rb:113:in `send' 来自 C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rails-2.3.4/lib/initializer.rb:113:in `run' 来自 C:/CodeMetrics/2nd/cmusv/config/environment.rb:17 来自 ./test/test_helper.rb:2:in `require' 来自 ./test/test_helper.rb:2 来自 ./test/functional/courses_controller_test.rb:1:in `require' 来自 ./test/functional/courses_controller_test.rb:1 来自 C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in `load' 来自 C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5 来自 C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in `each' 来自 C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5 C:/Ruby187/bin/ruby.exe -I"lib;test" "C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb " 运行 test:units 和 test:functionals 时出错! 空的测试套件。 进程以退出代码 1 结束
从命令行运行和在 RubyMine 中运行有什么区别?