Joiey.Seeley
4/26/2006 9:12:00 PM
I am using test/unit to perform unit testing of my Ruby application.
My individual test cases work fine, but I'm running into path issues
when I try to rollup into a suite.
I have some classes that are intended to be reusable outside of the
application I am currently developing so I have a directory structure
similar to this.
src/
application classes go here
my_test_suite.rb
src/utilityClassesOne/
utility.rb
my_utility_testcase.rb
src/utilityClassesTwo/
src/utilityClasses.../
src/utilityClassesX/
In my_utility_testcase.rb I would use something like this
require 'utility'
Then I can run my testcase within that directory and it will work fine.
I want my test suite to run all of the utility test cases as well as
the main application test cases. When I try to run my_test_suite.rb it
errs out because it seems to be treating my_utility_testcase as if it
resides in the src/ directory.
If I update the the require within my_utility_testcase.rb to
require 'utilityClassesOne/utility' then my_test_suite will run
successfully, but my_utility_testcase.rb will fail when it is run
individually...
My dilemma is making this work correctly at both levels; this way I get
complete testing during this development and when I am done I can drop
the utilities into a common src library and reuse them elsewhere
without always trying to fix path issues.