
這個套餐允許您從 Sublime Text 2 中執行 rspec 和其他一些測試框架的測試。我還沒有找到任何結論性的東西。
答案1
有可能,我正在使用 Sublime Text 2 +Ruby測試與 Rails 4.1.5/ruby 2.1.2 一起打包,但它應該適用於任何其他 Rails 4+ 版本。
在 Sublime 中,前往Preferences > Package Settings > RubyTest > Settings - Default
或僅搜尋RubyTest.sublime-settings
.
您必須調整 ruby_unit 命令的路徑(這些與 minitest 一起使用)
"run_ruby_unit_command": "rake test {relative_path}",
"run_single_ruby_unit_command": "rake test {relative_path} {test_name}",
如果您使用的是 spring,您可以修改spring
在每個 rake 之前加入
"run_ruby_unit_command": "spring rake test {relative_path}",
"run_single_ruby_unit_command": "spring rake test {relative_path} {test_name}",
或者bin/rake
如果你有彈簧箱存根
"run_ruby_unit_command": "bin/rake test {relative_path}",
"run_single_ruby_unit_command": "bin/rake test {relative_path} {test_name}",
保存文件,也許重新啟動 sublime (我不必),它應該可以工作。