close file before renaming

Renaming an open file is not possible on windows
Is there a test for this? if so I think it would be healthy if said test would reflect this limtation of windows for future reference.