我能够从RubyMine运行/调试简单脚本,但在运行现有测试时遇到错误。
我的Rakefile包含:
Rake::TestTask.new(:test) do |t|
t.libs << "test"
t.libs << "lib"
t.test_files = FileList["test/**/*_test.rb"]
end
执行时,我的测试按预期运行:
bundle exec rake test
但是当我尝试从第一行包含require 'test_helper
的RubyMine运行测试时,我收到以下错误:
/Users/me/.rvm/rubies/ruby-2.1.3/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in“require”:无法加载此类文件 - test_helper(LoadError)
运行表单RubyMine时是否可以设置libs值,类似于我的Rakefile?
修改的
将我的工作目录设置为 myproject / tests并将-Itest
添加到我的Ruby参数后,require test_helper
行成功。但是,RubyMine仍会在我的下一个需求行上提供LoadError,这需要来自我的Gemfile中定义的gem的本地依赖项。同样,测试从终端按预期运行,如何配置RubyMine以使用我的Gemfile中定义的gem?