You have two options:
Option 1 - Use the gem to fake
FakeFS , , , . FakeFS , , Ruby standard lib, - - .
2 - ,
/ , . , .
:
$root = ENV['ROOT_DIR'] || '/'
File.open(File.join($root,'some_file'),'w') do |file|
end
ROOT_DIR , , .
chroot , .
Dir.chroot(ENV['ROOT_DIR'] || '/')
File.open('/some_file','w') do |file|
end
. man chroot.
2.