20 lines
288 B
Ruby
20 lines
288 B
Ruby
|
#
|
||
|
# Wrapper for Ruby's file services, replaced during testing
|
||
|
# so we can run tests without touching a real filesystem.
|
||
|
#
|
||
|
|
||
|
class FileService
|
||
|
|
||
|
def open(*args)
|
||
|
super(*args)
|
||
|
end
|
||
|
|
||
|
def exist?(name)
|
||
|
File.exist?(name)
|
||
|
end
|
||
|
|
||
|
def dir_entries(name)
|
||
|
Dir.entries(name)
|
||
|
end
|
||
|
end
|