[Rake-devel] test_each_dir_parent failure on Win32

Daniel Berger djberge at qwest.com
Mon May 9 16:52:37 EDT 2005

Jim Weirich wrote:
> Berger, Daniel said:
>>Hi all,
>>This test failure appears to be separate from the shell issue:
>>5) Failure:
>>test_each_dir_parent(TestRake) [./test/test_rake.rb:11]:
>><["c:/a/b", "c:/a", "c:"]> expected but was
>><["c:/a/b", "c:/a", "c:/"]>.
>>I'm not familiar enough with "alldirs" to know whether the third element
>>should be "c:" or "c:/".  Thoughts?
> This seems to be system dependent behavior.  On Linux, "c:" is probably
> the right answer because it is not treating "c:" differently than any
> other set of characters.  On windows, "c:/" is probably the better answer.
> We can address this in the test case by allowing either option for test
> success (or make a system dependent test).  Either way, I'm satisfied with
> this.

How's this?

--- test_rake.orig      Mon May  9 14:47:37 2005
+++ test_rake.rb        Mon May  9 14:49:10 2005
@@ -4,11 +4,16 @@
  require 'rake'

  class TestRake < Test::Unit::TestCase
+  def setup
+    @root = 'c:'
+    @root = 'c:/' if File::ALT_SEPARATOR
+  end
    def test_each_dir_parent
      assert_equal ['a'], alldirs('a')
      assert_equal ['a/b', 'a'], alldirs('a/b')
      assert_equal ['/a/b', '/a', '/'], alldirs('/a/b')
-    assert_equal ['c:/a/b', 'c:/a', 'c:'], alldirs('c:/a/b')
+    assert_equal ['c:/a/b', 'c:/a', @root], alldirs('c:/a/b')
      assert_equal ['c:a/b', 'c:a'], alldirs('c:a/b')



More information about the Rake-devel mailing list