Project

General

Profile

Bug #7707 » test.rb

Test script (requires bindfs and linux but easy enough to modify) - mpartel (Martin Pärtel), 01/17/2013 04:05 AM

 

# Requires http://code.google.com/p/bindfs/ and linux. Can be apt-get'ed.

require 'fileutils'

def test
FileUtils.rm_rf('testdir')
FileUtils.mkdir('testdir')
Dir.chdir 'testdir' do
FileUtils.mkdir_p('fs1/from')
FileUtils.mkdir_p('fs2/to')
system('bindfs fs2 fs2')
begin
Dir.chdir 'fs1/from' do
system('ln -sf a b')
FileUtils.touch('a')
end
FileUtils::Verbose.mv('fs1/from', 'fs2/to')
ensure
system('fusermount -uz fs2') # Mac users can try umount instead of fusermount -u
end
end
end


begin
100.times { test }
ensure
FileUtils.rm_rf('testdir')
end
    (1-1/1)