Modified: branches/0.2.0/CREDITS (186 => 187)
--- branches/0.2.0/CREDITS 2008-01-11 10:17:35 UTC (rev 186)
+++ branches/0.2.0/CREDITS 2008-01-11 10:29:37 UTC (rev 187)
@@ -12,13 +12,14 @@
=============
Pádraic Brady (English)
-TAKAGI Masahiro (Japanese)
+Takagi Masahiro (Japanese)
Bug Fixes/Patches
=================
-KUBO Atsuhiro (3 bugs with resolving patches on 08 January 2008)
-TAKAGI Masahiro (manual inaccuracy patched on 08 January 2008)
+Harley Bussell (HTML Runner and Reporter submission)
+Kubo Atsuhiro (3 bugs with resolving patches on 08 January 2008)
+Takagi Masahiro (manual inaccuracy patched on 08 January 2008)
Others
======
Modified: branches/0.2.0/build/build.xml (186 => 187)
--- branches/0.2.0/build/build.xml 2008-01-11 10:17:35 UTC (rev 186)
+++ branches/0.2.0/build/build.xml 2008-01-11 10:29:37 UTC (rev 187)
@@ -44,7 +44,7 @@
<property name="spec.src.default" value="${project.basedir}/.." />
<property name="spec.src.classpath" value="/src" />
<property name="spec.name" value="PHPSpec" />
- <property name="spec.version" value="0.2.1" /> <!-- VERSION FOR EDITING -->
+ <property name="spec.version" value="0.2.2" /> <!-- VERSION FOR EDITING -->
<property name="spec.stability" value="stable" />
<property name="spec.svn.baseurl" value="http://phpspec.googlecode.com/svn/" />
<property name="spec.svn.url" value="${svn.url}/trunk" />
@@ -216,6 +216,12 @@
<install as="phpspec.bat" name="scripts/phpspec.bat" />
</release>
+ <changelog version="0.2.2" date="2008-01-11" license="LGPL">
+ * Patched a Predicate issue courtesy of Takagi Masahiro
+ and Kubo
+ * Added new PCRE regular expression matcher "matches()"
+ </changelog>
+
<changelog version="0.2.1" date="2008-01-09" license="LGPL">
* Fixes a minor output bug missed in QA for HTML and TEXT
reporters
Modified: branches/0.2.0/src/PHPSpec/Specification.php (186 => 187)
--- branches/0.2.0/src/PHPSpec/Specification.php 2008-01-11 10:17:35 UTC (rev 186)
+++ branches/0.2.0/src/PHPSpec/Specification.php 2008-01-11 10:29:37 UTC (rev 187)
@@ -122,7 +122,7 @@
// check for Matcher references
$matchers = array(
- 'equal', 'be', 'beEqualTo', 'beAnInstanceOf', 'beGreaterThan', 'beTrue', 'beFalse', 'beEmpty', 'beLessThan', 'beGreaterThanOrEqualTo', 'beLessThanOrEqualTo', 'beSet', 'beNull', 'beOfType', 'beIdenticalTo', 'match'
+ 'equal', 'be', 'beEqualTo', 'beAnInstanceOf', 'beGreaterThan', 'beTrue', 'beFalse', 'beEmpty', 'beLessThan', 'beGreaterThanOrEqualTo', 'beLessThanOrEqualTo', 'beSet', 'beNull', 'beOfType', 'beIdenticalTo', 'match', 'throw'
);
if (in_array($method, $matchers)) {
$this->setExpectedValue(array_shift($args));
@@ -132,13 +132,10 @@
}
// check for any predicate style matching
- $result = preg_match("/^((be)|(have)|(beA)|(haveA)|(haveAn)|(beAn))*/", $method, $matches);
+ $result = preg_match("/^((?:be|have)A?n?)(.*)/", $method, $matches);
if ($result && empty($args) && $this instanceof PHPSpec_Specification_Object) {
- $predicate = $matches[0];
- $predicateSuffix = substr($method, strlen($predicate));
- if (!isset($predicateSuffix) || empty($predicateSuffix)) {
- $predicateSuffix = '';
- }
+ $predicate = $matches[1];
+ $predicateSuffix = $matches[2];
if (strpos($predicate, 'have') !== false) {
$predicateMethodPrefixes = array('has', 'hasA', 'hasAn');
@@ -369,4 +366,4 @@
}
}
-}
\ No newline at end of file
+}