RubyMine does not recognize *.spec files as runnable (?) in popup menu
This issue is occurring on windows, running RubyMine 3.2.3.
When I right-click within the editor of the XXX_spec.rb file, I would expect to see two options in the middle to run the spec: 'Run "<object> <context>..."' and 'Debug "<object> <context>..."'. However, neither of them appear at all.
I can run all of the specs in the project by right-clicking on the *spec* folder and selecting "Run all specs in :spec...". Also, the *spec* folder is green -- it is identified in the project as a Test Sources location.
One more interesting observation... Right-clicking on one of our Cucumber features (any XXX.feature file under *features) does show the Run and Debug options and comes up *very fast*. Right-clicking on a spec takes a long time (over 10 seconds)!
Any suggstions as to why RubyMine will not identify our specs as runnable specs?
Thanks in advance,
--Scott
请先登录再写评论。
Hi Scott,
Does your project use bundler? Is it Rails app? Does your file require 'rspec' directly or 'spec_helper' which requires 'rspec' or 'rspec-rails' ? In current implementation rspec run configuration will be suggested if RubyMine understands that your project use rspec gem (e.g. it is mentioned in gemfile) and code insight detects that rspec framework classes will be loaded on runtime for current file, i.e. it requires 'rspec' script directly or indirectly from helper scripts.
Smth goes wrong, could you capture a CPU snapshot as described at http://devnet.jetbrains.net/docs/DOC-1144 ?
Hello,
I've the same issue with RubyMine 2017.1. I understand what RubyMine does to detect RSpec, but in our case we removed all require 'spec_heper' in our spec files since we have a .rspec common configuration file which take care of that.
http://www.rubydoc.info/github/rspec/rspec-core/RSpec/Core/Configuration
Thanks
Eric
Eric,
it appears to be a known problem, please vote for it:
https://youtrack.jetbrains.com/issue/RUBY-19106
Nice, thank you for quick response