I am wondering why this is: In Test/Unit I am iterating a directory so that I can require each of the files in the directory.
When I call Dir.glob, the root is the Rails_root, however when I iterate the files I get an error if I use Rails root and must begin the included file’s path from within the test directory.
This:
integration/helpers/file.rb
And not
test/integration/helpers/file.rb
I assume this is due somehow to Test/Unit running and having its own assumed root directory in “test/” and not Rails root.
So is there a prettier method of doing this"
Dir.glob("test/integration/helpers/.rb").each do |helper_file| require helper_file.gsub(/test//, ‘’) # for some reason the Dir.glob starts at rails root but when requiring, it starts within test/ end