Diff
Property changes:
Name: svk:merge
- d6e91ea2-e33a-0410-98df-1d493bd67c58:/:194
+ d6e91ea2-e33a-0410-98df-1d493bd67c58:/:195
Modified: branches/zend/build/build.xml (194 => 195)
--- branches/zend/build/build.xml 2008-01-14 21:15:54 UTC (rev 194)
+++ branches/zend/build/build.xml 2008-01-14 22:17:01 UTC (rev 195)
@@ -222,6 +222,12 @@
application to ZF Controller development
</changelog>
+ <changelog version="0.2.3" date="2008-01-11" license="LGPL">
+ * Patched a Predicate issue courtesy KUBO Atsuhiro
+ * Reminder to self that no regression testing coupled with
+ a busy day equals a bad time to make a release!
+ </changelog>
+
<changelog version="0.2.2" date="2008-01-11" license="LGPL">
* Patched a Predicate issue courtesy of Takagi Masahiro
and Kubo
Copied: branches/zend/src/PHPSpec/Matcher/Match.php (from rev 184, branches/0.2.0/src/PHPSpec/Matcher/Match.php) (0 => 195)
--- branches/zend/src/PHPSpec/Matcher/Match.php (rev 0)
+++ branches/zend/src/PHPSpec/Matcher/Match.php 2008-01-14 22:17:01 UTC (rev 195)
@@ -0,0 +1,59 @@
+<?php
+/**
+ * PHPSpec
+ *
+ * LICENSE
+ *
+ * This file is subject to the GNU Lesser General Public License Version 3
+ * that is bundled with this package in the file LICENSE.
+ * It is also available through the world-wide-web at this URL:
+ * http://www.gnu.org/licenses/lgpl-3.0.txt
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to lic...@phpspec.org so we can send you a copy immediately.
+ *
+ * @category PHPSpec
+ * @package PHPSpec
+ * @copyright Copyright (c) 2007 P\xE1draic Brady, Travis Swicegood
+ * @license http://www.gnu.org/licenses/lgpl-3.0.txt GNU Lesser General Public Licence Version 3
+ */
+
+/**
+ * @category PHPSpec
+ * @package PHPSpec
+ * @copyright Copyright (c) 2007 P\xE1draic Brady, Travis Swicegood
+ * @license http://www.gnu.org/licenses/lgpl-3.0.txt GNU Lesser General Public Licence Version 3
+ */
+class PHPSpec_Matcher_Match implements PHPSpec_Matcher_Interface
+{
+
+ protected $_expected = null;
+
+ protected $_actual = null;
+
+ public function __construct($expected)
+ {
+ $this->_expected = $expected;
+ }
+
+ public function matches($actual)
+ {
+ $this->_actual = $actual;
+ return (bool) preg_match($this->_expected, $this->_actual);
+ }
+
+ public function getFailureMessage()
+ {
+ return 'expected match for ' . strval($this->_expected) . ' PCRE regular expression, got ' . strval($this->_actual) . ' (using match())';
+ }
+
+ public function getNegativeFailureMessage()
+ {
+ return 'expected no match for ' . strval($this->_expected) . ' PCRE regular expression, got ' . strval($this->_actual) . ' (using match())';
+ }
+
+ public function getDescription()
+ {
+ return 'match ' . strval($this->_expected) . ' PCRE regular expression';
+ }
+}
\ No newline at end of file
Modified: branches/zend/src/PHPSpec/Specification.php (194 => 195)
--- branches/zend/src/PHPSpec/Specification.php 2008-01-14 21:15:54 UTC (rev 194)
+++ branches/zend/src/PHPSpec/Specification.php 2008-01-14 22:17:01 UTC (rev 195)
@@ -132,7 +132,7 @@
}
// check for any predicate style matching
- $result = preg_match("/^((?:be|have)A?n?)(.*)/", $method, $matches);
+ $result = preg_match("/^((?:be|have)(?:A|An)?)(.*)/", $method, $matches);
if ($result && empty($args) && $this instanceof PHPSpec_Specification_Object) {
$predicate = $matches[1];
$predicateSuffix = $matches[2];
Copied: branches/zend/tests/Matcher/Match (from rev 184, branches/0.2.0/tests/Matcher/Match)