【问题标题】:RubyTest Not Outputting Test Results on Windows 7RubyTest 在 Windows 7 上不输出测试结果
【发布时间】:2013-01-16 01:35:59
【问题描述】:

我在 Windows 7 Pro 上并尝试将 RubyTest 与 Sublime Text 2 一起使用。我已经安装了它。我在测试结果窗口中没有得到任何输出。例如,如果我运行一个测试,我会在控制台中看到以下内容:

正在运行bin/rspec spec\features\static_pages_spec.rb -l9 重新加载/C/Users/jgriffin/AppData/Roaming/Sublime Text 2/Packages/User/RubyTest.last-run

如果我在 Dos 窗口的命令行中运行它,它就会执行。 如果我在 Git Bash 窗口的命令行中运行它,它不会。

我宁愿用完我的 Bash 窗口。我尝试在 Bash 和 DOS 命令窗口中从命令行运行 subl,但结果似乎总是相同的。完全没有输出。

我正在运行:

ruby 1.9.3p125 (2012-02-16) [i386-mingw32]

感谢任何帮助!

【问题讨论】:

  • 贴一些代码,伙计?您希望我们如何帮助您?

标签: windows-7 ruby-test


【解决方案1】:

如果您还没有通过 Sublime 在 Windows 上工作,您可能需要修改 User - RubyTest.sublime-settings 文件以包含 bundle exec 前缀。不久前我遇到了同样的问题。例如:

{
  "erb_verify_command": "bundle exec erb -xT - {file_name} | ruby -c",
  "ruby_verify_command": "bundle exec ruby -c {file_name}",

  "run_ruby_unit_command": "bundle exec ruby -Itest {relative_path}",
  "run_single_ruby_unit_command": "bundle exec ruby -Itest {relative_path} -n '{test_name}'",

  "run_cucumber_command": "bundle exec cucumber {relative_path}",
  "run_single_cucumber_command": "bundle exec cucumber {relative_path} -l{line_number}",

  "run_rspec_command": "bundle exec rspec {relative_path}",
  "run_single_rspec_command": "bundle exec rspec {relative_path} -l{line_number}",

  "ruby_unit_folder": "test",
  "ruby_cucumber_folder": "features",
  "ruby_rspec_folder": "spec",

  "ruby_use_scratch" : false,
  "save_on_run": false,
  "ignored_directories": [".git", "vendor", "tmp"]
}

【讨论】:

  • 我确实检查了文件。我正在使用 RSpec 并尝试了 bundle exec 和 bin/rspec。两者实际上都在我的命令行上工作。
【解决方案2】:

我遇到了同样的问题,调试控制台没有错误,实际控制台没有输出。

就我而言,我需要以管理员身份运行 sublime text(sublime_text.exe > 属性 > 兼容性 > 以管理员身份运行此程序)。

然后我通过 sublime text 重新运行测试,大约 10 秒后它终于输出了测试结果。

我希望这会有所帮助。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-08-13
    • 2011-05-05
    • 2014-01-09
    • 2019-03-01
    • 2021-11-22
    • 2017-07-23
    • 1970-01-01
    • 2015-10-01
    相关资源
    最近更新 更多