add file#split. Closes #61
This commit is contained in:
parent
129b557160
commit
2e55319dc0
@ -215,6 +215,10 @@ module FakeFS
|
|||||||
File::Stat.new(file, true)
|
File::Stat.new(file, true)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.split(path)
|
||||||
|
return RealFile.split(path)
|
||||||
|
end
|
||||||
|
|
||||||
class Stat
|
class Stat
|
||||||
attr_reader :ctime, :mtime
|
attr_reader :ctime, :mtime
|
||||||
|
|
||||||
|
@ -3,6 +3,14 @@ require "test_helper"
|
|||||||
class FakeFSTest < Test::Unit::TestCase
|
class FakeFSTest < Test::Unit::TestCase
|
||||||
include FakeFS
|
include FakeFS
|
||||||
|
|
||||||
|
def test_split
|
||||||
|
assert File.respond_to? :split
|
||||||
|
filename = "/this/is/what/we/expect.txt"
|
||||||
|
path,filename = File.split(filename)
|
||||||
|
assert_equal path, "/this/is/what/we"
|
||||||
|
assert_equal filename, "expect.txt"
|
||||||
|
end
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
FakeFS.activate!
|
FakeFS.activate!
|
||||||
FileSystem.clear
|
FileSystem.clear
|
||||||
|
Loading…
Reference in New Issue
Block a user