Sublime Text 3, rbenv, TestUnit, RubyTest and Spring correct configuation to get tests working

醉酒当歌 提交于 2019-12-20 04:48:12

问题


So I've setup RubyTest / Sublime Text 3 and that works fine. I'm having trouble getting spring to work in RubyTest. There is this cryptic setting:

"check_for_spring": false,

But when I set to true and run a test it just gives me the default spring command output e.g:

Version: 1.1.3

Usage: spring COMMAND [ARGS]

Commands for spring itself:

If I follow info on this url (https://github.com/rails/spring), correct way to call a test is?

bin/rake test test/functional/posts_controller_test.rb

Now my current settings for test running are:

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

If I try chaning to:

bin/rake test

This doesn't work, gives a command not found error even if I copy / paste the command path and it works in shell.

I'm out of ideas help!


回答1:


This will do the trick

"run_ruby_unit_command": "export PATH=~/.rbenv/shims:$PATH; bin/rake test -Itest {relative_path}",
"run_single_ruby_unit_command": "export PATH=~/.rbenv/shims:$PATH; bin/rake test {relative_path} {test_name}",



回答2:


I use this

"run_ruby_unit_command": "spring rake test {relative_path}",
"run_single_ruby_unit_command": "spring rake test {relative_path} {test_name}"


来源:https://stackoverflow.com/questions/23669651/sublime-text-3-rbenv-testunit-rubytest-and-spring-correct-configuation-to-get

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!