Refactor File mocking in server_test.rb