File.join delegates to RealFile.join. Closes #31

This commit is contained in:
Aaron Suggs 2010-01-12 13:50:08 -05:00 committed by Scott Taylor
parent 4bf5f91774
commit 31597f5836
2 changed files with 20 additions and 1 deletions

View File

@ -33,7 +33,7 @@ module FakeFS
end
def self.join(*parts)
parts * PATH_SEPARATOR
RealFile.join(parts)
end
def self.exist?(path)

View File

@ -0,0 +1,19 @@
require "test_helper"
class FileJoin < Test::Unit::TestCase
def setup
FakeFS.activate!
end
def teardown
FakeFS.deactivate!
end
[
["a", "b"], ["a/", "b"], ["a", "/b"], ["a/", "/b"], ["a", "/", "b"]
].each_with_index do |args, i|
define_method "test_file_join_#{i}" do
assert_equal RealFile.join(args), File.join(args)
end
end
end