From: Iain Barnett Date: 2010-09-27T21:21:55+09:00 Subject: Re: testing and requiring On 26 Sep 2010, at 21:59, Ryan Davis wrote: > Please don't do this. You're not in perl/whatever anymore, you're in ruby. Idiomatic ruby projects name their test directories "test" (or "spec") and name the test files as "test/test_class1.rb" (or "test/class1_test.rb" in rails land). If it means that much to you, then ok. > > If you do things properly, you don't need to define your own TestTask. Projects like hoe or jeweler will do everything for you cleanly and automatically. I won't be using hoe or jeweler. Such is my wont. > If you want to be lazy, you have each test file require "appname" since it pulls in everything else. If you want to be a software engineer, you have each file require whatever it directly depends on, so test/test_class1.rb only requires "appname/class1". My point is, should I be using relative paths to these files from the test file (or rake file, or wherever), or is there a better way to require the files? The idiomatic way seems to use lib/appname.rb to do this for running the app, what about for tests? What if I have a lib/appname/ext dir with changes to core classes, how do I add them in? Regards, Iain