I want autocompletion to work for an object that is instantiated in an included module.
Here are my steps.
- Create a new rspec test, require and include my module
- Call the modle method from the spec test that creates an attribute that will be used by the spec test.
- In the below example I call create_selenium_driver that creates the @browser varible
- In my test I want autocompetion to work and find all of the methods delevered for the selenium driver when I type brower. (ctrl +space)
I know that the problem is that in my rspec file it does not know the type for my instance variable "browser". Can I add this in configuration to bind Selenium::Client::Driver to the variable browser? Or is there something that I can do to help rubymine with the autocompletion?
@browser = Selenium::Client::Driver.new(
:host => ENV['HOST'] || "localhost",
:port => 4444,
:browser => ENV['SELENIUM_RC_BROWSER'] || "*firefox",
:url => target,
:timeout_in_second => 60)
describe "Test something through a browser" do
it "should open the browser and test the page" do