Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix #95 PHPSpec unable to find macros file

  • Loading branch information...
commit c73606bb0d77420687e99542fcc046d2c6843206 1 parent e6bdda9
@MarcelloDuarte MarcelloDuarte authored
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;
}
Please sign in to comment.
Something went wrong with that request. Please try again.