File.join delegates to RealFile.join. Closes #31
This commit is contained in:
parent
4bf5f91774
commit
31597f5836
@ -33,7 +33,7 @@ module FakeFS
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.join(*parts)
|
def self.join(*parts)
|
||||||
parts * PATH_SEPARATOR
|
RealFile.join(parts)
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.exist?(path)
|
def self.exist?(path)
|
||||||
|
19
test/fake/file/join_test.rb
Normal file
19
test/fake/file/join_test.rb
Normal 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
|
Loading…
Reference in New Issue
Block a user