Topic: :file_store cache not deleting file

Wanted to mess around with the cache in Rails 2.1 this morning ... setup the :file_store to point to tmp/cache, wrote a little test, everything passed. Wonderful. But if I look in the cache dir the file is still there. I looked at the source and everything seems fine ... so I pulled out the read, write, and delete lines that Rails calls and put them in their own test. They work perfectly! So why the heck would I see different behavior when using the cache itself?? Here's an example:

    setup do
      @c = Rails.cache
    should "write and read" do
      @c.write('key', 'value')
      assert_equal 'value','key')
    should "remove object on delete" do
      assert @c.delete('key')
    should "be able to delete files in tests" do'tmp/cache/test.cache', "wb+") { |f| f.write('foo') }
      v ='tmp/cache/test.cache', 'rb') { |f| }
      assert_equal v, 'foo'

Everything passes. End result is tmp/cache contains a key.cache but not a test.cache file. I'm befuddled.

Re: :file_store cache not deleting file

doh! That should have been obvious ... forgot that the code isn't necessarily executed in order.  The "remove" test was being called before the "write and read"  test.