Looks like we don’t need that rtrim() after all.
(+ a test, confirming)
This commit is contained in:
@@ -50,7 +50,7 @@ class Mustache_Loader_FilesystemLoader implements Mustache_Loader
|
||||
$this->baseDir = $baseDir;
|
||||
|
||||
if (strpos($this->baseDir, '://') === -1) {
|
||||
$this->baseDir = rtrim(realpath($this->baseDir), '/');
|
||||
$this->baseDir = realpath($this->baseDir);
|
||||
}
|
||||
|
||||
if (!is_dir($this->baseDir)) {
|
||||
|
||||
@@ -22,6 +22,13 @@ class Mustache_Test_Loader_FilesystemLoaderTest extends PHPUnit_Framework_TestCa
|
||||
$this->assertEquals('beta contents', $loader->load('beta.ms'));
|
||||
}
|
||||
|
||||
public function testTrailingSlashes()
|
||||
{
|
||||
$baseDir = realpath(dirname(__FILE__).'/../../../fixtures/templates/');
|
||||
$loader = new Mustache_Loader_FilesystemLoader($baseDir);
|
||||
$this->assertEquals('one contents', $loader->load('one'));
|
||||
}
|
||||
|
||||
public function testLoadTemplates()
|
||||
{
|
||||
$baseDir = realpath(dirname(__FILE__).'/../../../fixtures/templates');
|
||||
|
||||
Reference in New Issue
Block a user