Browse files

Fix #95 PHPSpec unable to find macros file

  • Loading branch information...
1 parent e6bdda9 commit c73606bb0d77420687e99542fcc046d2c6843206 @MarcelloDuarte MarcelloDuarte committed Sep 1, 2012
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/PHPSpec/World.php
View
7 src/PHPSpec/World.php
@@ -283,6 +283,13 @@ public function getMatcherFactory()
*/
public function includeMacros($macrosFile)
{
+ if (is_dir($this->_options['specFile'])) {
+ $macrosFile = $this->_options['specFile'] . DIRECTORY_SEPARATOR .
+ $macrosFile;
+ }
+ if (!file_exists($macrosFile) || !is_readable($macrosFile)) {
+ throw new Exception("Macro file $macrosFile not found");
+ }
$this->_macrosFile = $macrosFile;
}

0 comments on commit c73606b

Please sign in to comment.