function testCustomNamespace()
{
$this->ctx->logicalPath = 'foo';
$defaultNamespace = JstProcessor::$defaultNamespace;
JstProcessor::$defaultNamespace = "this.Pipe";
$jst = new JstProcessor(function () {
return <<<JS
function() { return "foo"; }
JS;
});
$this->assertEquals(<<<EXPECTED
(function() {
this.Pipe || (this.Pipe = {});
this.Pipe["foo"] = function() { return "foo"; };
}).call(this);
EXPECTED
, $jst->render($this->ctx));
JstProcessor::$defaultNamespace = $defaultNamespace;
}