public function testWriteDefaultCacheExpiry()
{
$file = new File(array('expiry' => '+1 minute'));
$key = 'default_keykey';
$data = 'data';
$time = time() + 60;
$closure = $file->write($key, $data);
$this->assertTrue(is_callable($closure));
$params = compact('key', 'data');
$result = $closure($file, $params, null);
$expected = 25;
$this->assertEqual($expected, $result);
$this->assertTrue(file_exists(Libraries::get(true, 'resources') . "/tmp/cache/{$key}"));
$this->assertEqual(file_get_contents(Libraries::get(true, 'resources') . "/tmp/cache/{$key}"), "{:expiry:{$time}}\ndata");
$this->assertTrue(unlink(Libraries::get(true, 'resources') . "/tmp/cache/{$key}"));
$this->assertFalse(file_exists(Libraries::get(true, 'resources') . "/tmp/cache/{$key}"));
}