Skip to content

Commit

Permalink
No cache requirement if cache option is false (#76)
Browse files Browse the repository at this point in the history
Fix #75
  • Loading branch information
kylekatarnls authored Oct 16, 2016
1 parent e9909b5 commit 7ddb29b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Jade/Jade.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ public function requirements($name = null)
{
$requirements = array(
'streamWhiteListed' => !$this->whiteListNeeded('suhosin'),
'cacheFolderExists' => $this->options['cache'] && is_dir($this->options['cache']),
'cacheFolderIsWritable' => $this->options['cache'] && is_writable($this->options['cache']),
'cacheFolderExists' => !$this->options['cache'] || is_dir($this->options['cache']),
'cacheFolderIsWritable' => !$this->options['cache'] || is_writable($this->options['cache']),
);

if ($name) {
Expand Down
11 changes: 11 additions & 0 deletions tests/features/issues.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,15 @@ public function testIssue73()

$this->assertSame('<p>foo</p>', $actual);
}

public function testIssue75()
{
$pug = new Pug(array(
'cache' => false,
));
$requirements = $pug->requirements();

$this->assertTrue($requirements['cacheFolderExists']);
$this->assertTrue($requirements['cacheFolderIsWritable']);
}
}

0 comments on commit 7ddb29b

Please sign in to comment.