title: Test::Unit how to test file operations and file content
body: <p>I'm looking for a way to test methods that use File class with test_unit.
  It's really the same thing that <a href="https://stackoverflow.com/questions/4070422/rspec-how-to-test-file-operations-and-file-content">issue</a> with Rspec but how to make it work with test_unit.</p>
  
  <pre><code>def foo
    File.open "filename", "w" do |file|
      file.write("text")
    end
  end
  </code></pre>
  
  <p>What will the test be :</p>
  
  <pre><code>require 'test/unit'
  
  def test_foo
  ...
  end
  </code></pre>
  
  <p>Thanks for your help.</p>