From john.ludlow.uk at gmail.com Mon Jul 3 06:23:10 2006 From: john.ludlow.uk at gmail.com (John Ludlow) Date: Mon, 3 Jul 2006 11:23:10 +0100 Subject: [Rake-devel] File tasks bug - comparing paths Message-ID: Hi, In Rake a file task may be something like file app_obj => app_cpp # compile end We've discovered that in some cases (such as where a path comes from the OS, an environment variable, say), it will contain backslashes, and sometimes (where Ruby has generated the path, or where we've coded it into the script - / is easier to read than \\) it will contain forward slashes. This difference seems to be significant when the paths are compared. This results in the situation where the equivalent paths c:\folder\app.cpp and c:/folder/app.cpp are treated as being completely different. (We also get a mix of slashes in a single path: c:\folder/app.cpp). It would make sense, IMHO, for these paths to be treated as the same. Is there any way to do this? The closest thing I could find was this: # Find a matching task for +task_name+. def [](task_name, scopes=nil) task_name = task_name.to_s self.lookup(task_name, scopes) or enhance_with_matching_rule(task_name) or synthesize_file_task(task_name) or fail "Don't know how to build task '#{task_name}'" end I suppose I'd have to override this to loop through all the prerequisites and compare them, making the slashes on both sides consistent? Thanks John -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rake-devel/attachments/20060703/5c34d336/attachment.html From jeremy.burks at gmail.com Mon Jul 31 18:29:45 2006 From: jeremy.burks at gmail.com (Jeremy Burks) Date: Mon, 31 Jul 2006 17:29:45 -0500 Subject: [Rake-devel] test only fails when run through rake Message-ID: Hello, I have a TestTask setup to run my tests. However, one of my tests unexpectedly fails with " is not true" when i run it through rake. If i run the test file directly, it passes as expected. at first, i thought this behavior was isolated to just the one test but i changed the order the tests are run and that causes a different test to fail when it should pass. here are the contents of my Rakefile (i removed everything else to narrow the scope of the problem): require 'rubygems' require 'rake/testtask' task :default => :test Rake::TestTask.new do |t| t.pattern = 'test/**/*_test.rb' t.verbose = true t.warning = false end Any ideas? Thanks. jeremy