Here’s the test task in my rake file. Works on Windows, but not on my Mac. It just hangs. What’s the problem?
Rake::TestTask.new do |t| t.libs << "./app;./test" t.test_files = FileList['test/test*.rb'] t.verbose = true end
Two hours later, I tell you that I need this on my Mac.
Rake::TestTask.new do |t| t.libs << "./app:./test" t.test_files = FileList['test/test*.rb'] t.verbose = true end
See the difference? Semi-colon…colon…Wow…
6 Responses to “Rake TestTask Hangs”
Leave a Reply
Does Rake have some kind of OS-sensitive path-maker function? That’s the kind of difficult-to-debug problem which could really use some abstraction…
Obviously not that I know of…:-). I made the same mistake in Java a while back with the file separator, and quickly changed my code to use the system property instead of hardcoding the back/forward slash.
IIRC, Ruby automatically converts file path separators for file operations (so using / vs \ isn’t a problem and there’s no need to use File::SEPARATOR).
As to this problem — I’ve never seen someone try a colon/semicolon, environment variable style — I’m more surprised it worked at all (since it’s $: that’s being modified). I’d use t.libs += %w(app lib), and skip the ./s, since they’re superfluous.
I meant t.libs += %w(app test), obviously
Bruce,
I’m pretty sure I picked up the syntax from the Pickaxe book. While I enjoy Ruby, I’m no expert, so thanx for the tip on a better way of doing things.
Kirk, np