Skip to content
Browse files

More properly create/invoke matchers.

  • Loading branch information...
1 parent 723a515 commit c8dc961bf3f2ca9867a1ea7bce71ce91efdd11c1 @martymcguire martymcguire committed Feb 27, 2012
Showing with 4 additions and 3 deletions.
  1. +4 −3 src/MiniSpec/expector.php
View
7 src/MiniSpec/expector.php
@@ -21,9 +21,10 @@ public function __call($name, $arguments)
// throw new Exception("No expectation named ".$name);
// }
- if( array_key_exists($name, $expectations) ) {
- $expectations[$name]::matcher($this->subject, $arguments);
- } else {
+ if( array_key_exists($name, $this->expectations) ) {
+ $matcher = new $this->expectations[$name];
+ $matcher->matcher($this->subject, $arguments);
+ } else {
throw new Exception("No expectation named ".$name);
}
}

0 comments on commit c8dc961

Please sign in to comment.
Something went wrong with that request. Please try again.