Load paths not working in ruby application for rspec tests
Hi:
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.
Please sign in to leave a comment.
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.
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.
spec/spec_helper.rb
$LOAD_PATH << File.expand_path('../../../lib', __FILE__)
require 'codebreaker'