Module: TestFs::Helper

Included in:
Test::Unit::TestCase
Defined in:
lib/test_fs/helper.rb

Instance Method Summary collapse

Instance Method Details

#setup_filesystem(&block) ⇒ Object

Register and create a filesystem for use in tests. Yields an instance of the root of the filesystem and returns that instance as well. This method is automatically mixed in to Test::Unit::TestCase



8
9
10
11
12
13
14
15
# File 'lib/test_fs/helper.rb', line 8

def setup_filesystem(&block)
  root_directory = TestFs::RootDirectory.new

  block.call(root_directory)
  root_directory.create!

  root_directory
end