individual specs don't run in jruby
If I run a spec file with jruby as the sdk it evaluates the file, but it doesn't run the spec. I.e. if I put a puts outside the spec block I can see it in the output of the run, but the spec block never gets executed. With MRI as the sdk it works fine. Is this a bug or is there some configuration I need to change.
请先登录再写评论。
Are you sure that valid rspec gem is attached to you project in File | Settings | Ruby SDK and Gems (when jruby sdk is selected) ? Could you post a screenshot here?
I isn't attached, but it isn't attached for the mri SDK either. Does that one work differently or something?
Which MRI do you use? It seems I've reproduced it on ruby19. I've just noticed that Ruby19 interpreter adds all gems' "lib" folders in LOAD_PATH
So with Ruby19 interpreter RubyMine understands require "spec" (because "spec" file is in load path) and load code insight support. In case of Ruby18 and JRuby load path doesn't contain gems' lib folders so RubyMine cannot understand require "spec" if "rspec" gem isn't attached. Actually I don't know is such behaviour bug or feature of Ruby19. Our special support for rspec/test-spec/cucumber/rails is based on attached gems in RubyMine's Gem manager, so I recommend you to attach rspec gem to your project for both sdks.
I've google a little. Yes, such ruby 1.9 load path behaviour is new feature (http://books.google.com/books?id=jcUbTcr5XWwC&lpg=PA254&ots=fHEnrcbycF&dq=ruby%201.9%20loadpath&pg=PA254). I've filled an issue http://www.jetbrains.net/jira/browse/RUBY-4473
Thanks for all the help. It works fine in jruby if I add the rspec gem as you suggested earlier so I'm just curious why I didn't need to do that with mri. It still works fine in ruby 1.8.7 without having the rspec gem added.


Here you can see that the spec ran without having the rspec gem in the mri config
Because you executed it as ordinary ruby file using ruby interpreter.

Look at my screenshot, it is better =)
thanks again for the help