我已经将一个RubyMine加载到RubyMine中,与往常一样,它的规范文件位于spec目录中。右击并选择“运行”对任何单一的规范文件正确运行它。右键单击并选择specs目录上的“run”将导致每个测试失败,并收到以下消息:
未能加载: /Users/nathaniel/repos/close-web/spec/compositions/analysis/analysis_data_spec.rb:1异常消息:无法加载这样的文件-- spec_helper
在启动配置中,“测试文件夹”的设置似乎是正确的:
/Users/nathaniel/repos/close-web/spec以及工作目录:
/Users/nathaniel/repos/close-webRuby参数的设置如下:
-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) -Itest( RubyMine网站上有一些迹象表明,需要-Itest。)在Bundler选项卡下,“在包的上下文中运行脚本”也会被选中。我不清楚RubyMine还需要什么才能递归地查找和执行测试。从命令行运行它们可以正常工作:
~repos/closeweb $ bundle exec rspec spec
... (all the tests running)
Finished in 6 minutes 27 seconds (files took 13.39 seconds to load)
1054 examples, 0 failures, 108 pending什么配置是错误的,所有的测试都不会运行?
发布于 2017-09-20 09:02:53
如果您的文件夹名为spec,而不是test,则需要-Ispec,而不是-Itest。
换句话说,您的RubyMine参数应该是:
-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) -Ispec来自ruby手册页
-I directory Used to tell Ruby where to load the library scripts.
Directory path will be added to the load-path variable ($:)https://stackoverflow.com/questions/46310375
复制相似问题