PHP Classes

File: public/js/lib/director/test/server/core/on-test.js

Recommend this page to a friend!
  Classes of Sergey Beskorovayniy   Silex MVC Blog   public/js/lib/director/test/server/core/on-test.js   Download  
File: public/js/lib/director/test/server/core/on-test.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Silex MVC Blog
MVC based blog using on the Silex micro-framework
Author: By
Last change:
Date: 8 years ago
Size: 1,007 bytes
 

Contents

Class file image Download
/* * on-test.js: Tests for the on/route method. * * (C) 2011, Charlie Robbins, Paolo Fragomeni, & the Contributors. * MIT LICENSE * */ var assert = require('assert'), vows = require('vows'), director = require('../../../lib/director'); vows.describe('director/core/insert').addBatch({ "An instance of director.Router": { topic: new director.Router(), "the on() method": { "['foo', 'bar']": function (router) { function noop () { } router.on(['foo', 'bar'], noop); assert.strictEqual(router.routes.foo.on, noop); assert.strictEqual(router.routes.bar.on, noop); }, "'baz'": function (router) { function noop () { } router.on('baz', noop); assert.strictEqual(router.routes.baz.on, noop); }, "'after', 'baz'": function (router) { function noop () { } router.on('after', 'boo', noop); assert.strictEqual(router.routes.boo.after, noop); } } } }).export(module);