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
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.