On Jul 23, 9:28 pm, Carl J. email@example.com wrote:
In order to test the new_file.rb my new_test.rb must have the path to
the new_file.rb as the require correct? Something like require
Or is there a different way to do that?
Thanks for all the help - (everyone) this is most helpful!
I would play with the $LOAD_PATH in your spec_helper or whatnot:
require “spec_helper” # require in every spec file
require “my_class” # now it’s possible to require my_class from lib
dir because of changed $LOAD_PATH
describe MyClass do
it “test, test, test!” do
Or, if using really RSpec, then create a spec.opts file into the spec
directory and require it from there:
Then you can remove those require statements from spec files
themselves. Although if you’re using some kind of an IDE, then they
might get confused, but i don’t mind