Modified: branches/zend/specs/ContextZendSpec.php (196 => 197)
--- branches/zend/specs/ContextZendSpec.php 2008-01-14 22:21:02 UTC (rev 196)
+++ branches/zend/specs/ContextZendSpec.php 2008-01-14 22:25:03 UTC (rev 197)
@@ -58,22 +58,30 @@
public function itShouldFormulateAndDispatchGetRequest()
{
- PHPSpec_Context_Zend::addModuleDirectory(
- dirname(__FILE__) . DIRECTORY_SEPARATOR . '_modules'
+ PHPSpec_Context_Zend::addControllerDirectory(
+ dirname(__FILE__)
+ . DIRECTORY_SEPARATOR . '_zend'
+ . DIRECTORY_SEPARATOR . 'application'
+ . DIRECTORY_SEPARATOR . 'controllers'
);
$context = new DescribeFooController;
$context->beforeEach();
- $context->setController('phpspec');
- $response = $context->get('pget', array('text', 'hello1'));
- $this->spec($response)->should->be('hello1');
+ $context->setController('index');
+ $response = $context->get('index');
+ $this->spec($response)->should->match("/This is Index/");
}
public function after()
{
PHPSpec_Context_Zend::clearModuleDirectories();
+ PHPSpec_Context_Zend::clearControllerDirectories();
}
}
+/**
+ * DescribeFooController is just an entry point. The actual controller
+ * is manually set so we don't need subclass bloat for specs
+ */
class DescribeFooController extends PHPSpec_Context_Zend
{
}
\ No newline at end of file