Is there any way to avoid the "unresolved ruby reference" warning in RubyMine IDE? for example, when some code in my view calls a method of the view helper, I get the "unresolved ruby reference" warning even though the code works.
The case described above is just one of many. Another example is when using RSpec:
it "should require an email" do
no_email_user = User.new(@attr.merge(:email => ""))
no_email_user.should_not be_valid
end
the parameter "be_valid" is not known to the RubyMine IDE.
My question is - is there any way to solve this? should I require additional files? should I do something differently? Those false positives regarding unresolved ruby methods/constants are really disturbing, and it also affects the results of the "find usages" action in RubyMine.
I'm using RubyMine 3.1 I would really appreciate any help in resolving this issue.
This issue is already submitted to the RubyMine bug tracker, please watch/vote.
I think in this case this is hard to solve. Ruby allows great magic to happen using method_missing
and as far as i know, the be_valid
is also implemented in this way. Actually there is no be_valid
but it calls the valid?
method and expects it to be true.
In rspec, this work for any method ending in a ?
. So if you have a method ready?
, you can write should be_ready
.
I am a fulltime Rubymine user, but i do not know how they could solve that nor do i expect it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With