Load paths not working in ruby application for rspec tests


I have set up load paths for the project and test folders, but when I right click and launch a test explicitly, it fails to find requires. If I specify them explicity, e.g.

require 'd:\rspec-stuff\codebreaker\lib\codebreaker'

The test will successfully run. But,

require 'codebreaker'

will not.

I am on windows with Rubymine 3.2.1.

Am I missing something on  configuration? Thanks.

Comment actions Permalink

I might note that the require does find the files for auto-filling, so it seems Rubymine (at least) recognizes the load paths, but not the tests.

Comment actions Permalink

So, noob with rspec. In the spec_helper, explicitly adding source code path did the trick. Assumed load_paths were some how used from project in Rubymine, but apparently not.


$LOAD_PATH << File.expand_path('../../../lib', __FILE__)
require 'codebreaker'


Please sign in to leave a comment.