implement File::Stat#size
This commit is contained in:
parent
7f601eb7fc
commit
4530cb1e31
@ -192,6 +192,10 @@ module FakeFS
|
||||
def nlink
|
||||
FileSystem.find(@file).links.size
|
||||
end
|
||||
|
||||
def size
|
||||
File.size(@file)
|
||||
end
|
||||
end
|
||||
|
||||
attr_reader :path
|
||||
|
@ -67,4 +67,9 @@ class FileStatTest < Test::Unit::TestCase
|
||||
|
||||
assert_equal 2, File.stat("testfile").nlink
|
||||
end
|
||||
|
||||
def test_file_size
|
||||
File.open('testfile', 'w') { |f| f << 'test' }
|
||||
assert_equal 4, File.stat('testfile').size
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user