├── spec
├── node_modules
│ ├── mocha
│ │ ├── lib
│ │ │ ├── browser
│ │ │ │ ├── fs.js
│ │ │ │ ├── path.js
│ │ │ │ ├── debug.js
│ │ │ │ ├── tty.js
│ │ │ │ └── progress.js
│ │ │ ├── interfaces
│ │ │ │ ├── index.js
│ │ │ │ ├── exports.js
│ │ │ │ ├── qunit.js
│ │ │ │ ├── tdd.js
│ │ │ │ └── bdd.js
│ │ │ ├── template.html
│ │ │ ├── reporters
│ │ │ │ ├── templates
│ │ │ │ │ ├── menu.jade
│ │ │ │ │ ├── script.html
│ │ │ │ │ └── coverage.jade
│ │ │ │ ├── index.js
│ │ │ │ ├── min.js
│ │ │ │ ├── html-cov.js
│ │ │ │ ├── json-stream.js
│ │ │ │ ├── doc.js
│ │ │ │ ├── json.js
│ │ │ │ ├── dot.js
│ │ │ │ ├── list.js
│ │ │ │ ├── tap.js
│ │ │ │ ├── teamcity.js
│ │ │ │ ├── landing.js
│ │ │ │ ├── spec.js
│ │ │ │ ├── progress.js
│ │ │ │ ├── markdown.js
│ │ │ │ └── xunit.js
│ │ │ ├── test.js
│ │ │ ├── hook.js
│ │ │ ├── context.js
│ │ │ └── ms.js
│ │ ├── node_modules
│ │ │ ├── .bin
│ │ │ │ └── jade
│ │ │ ├── ms
│ │ │ │ ├── .npmignore
│ │ │ │ ├── Makefile
│ │ │ │ ├── component.json
│ │ │ │ ├── History.md
│ │ │ │ ├── test
│ │ │ │ │ ├── index.html
│ │ │ │ │ └── test.js
│ │ │ │ ├── README.md
│ │ │ │ ├── package.json
│ │ │ │ └── ms.js
│ │ │ ├── mkdirp
│ │ │ │ ├── .npmignore
│ │ │ │ ├── .gitignore.orig
│ │ │ │ ├── .travis.yml
│ │ │ │ ├── .gitignore.rej
│ │ │ │ ├── examples
│ │ │ │ │ ├── pow.js
│ │ │ │ │ ├── pow.js.orig
│ │ │ │ │ └── pow.js.rej
│ │ │ │ ├── test
│ │ │ │ │ ├── root.js
│ │ │ │ │ ├── return.js
│ │ │ │ │ ├── return_sync.js
│ │ │ │ │ ├── clobber.js
│ │ │ │ │ ├── perm.js
│ │ │ │ │ ├── mkdirp.js
│ │ │ │ │ ├── sync.js
│ │ │ │ │ ├── umask.js
│ │ │ │ │ ├── umask_sync.js
│ │ │ │ │ ├── rel.js
│ │ │ │ │ ├── chmod.js
│ │ │ │ │ ├── perm_sync.js
│ │ │ │ │ └── race.js
│ │ │ │ ├── LICENSE
│ │ │ │ ├── README.markdown
│ │ │ │ ├── package.json
│ │ │ │ └── index.js
│ │ │ ├── debug
│ │ │ │ ├── .npmignore
│ │ │ │ ├── index.js
│ │ │ │ ├── example
│ │ │ │ │ ├── wildcards.js
│ │ │ │ │ ├── app.js
│ │ │ │ │ ├── worker.js
│ │ │ │ │ └── browser.html
│ │ │ │ ├── component.json
│ │ │ │ ├── History.md
│ │ │ │ ├── lib
│ │ │ │ │ └── debug.js
│ │ │ │ └── debug.js
│ │ │ ├── commander
│ │ │ │ ├── .npmignore
│ │ │ │ ├── index.js
│ │ │ │ ├── .travis.yml
│ │ │ │ ├── Makefile
│ │ │ │ └── History.md
│ │ │ ├── jade
│ │ │ │ ├── node_modules
│ │ │ │ │ └── mkdirp
│ │ │ │ │ │ ├── .npmignore
│ │ │ │ │ │ ├── .gitignore.orig
│ │ │ │ │ │ ├── .gitignore.rej
│ │ │ │ │ │ ├── examples
│ │ │ │ │ │ ├── pow.js
│ │ │ │ │ │ ├── pow.js.orig
│ │ │ │ │ │ └── pow.js.rej
│ │ │ │ │ │ ├── test
│ │ │ │ │ │ ├── sync.js
│ │ │ │ │ │ ├── clobber.js
│ │ │ │ │ │ ├── umask_sync.js
│ │ │ │ │ │ ├── perm.js
│ │ │ │ │ │ ├── mkdirp.js
│ │ │ │ │ │ ├── umask.js
│ │ │ │ │ │ ├── rel.js
│ │ │ │ │ │ ├── chmod.js
│ │ │ │ │ │ ├── perm_sync.js
│ │ │ │ │ │ └── race.js
│ │ │ │ │ │ ├── README.markdown
│ │ │ │ │ │ ├── LICENSE
│ │ │ │ │ │ ├── package.json
│ │ │ │ │ │ └── index.js
│ │ │ │ ├── testing
│ │ │ │ │ ├── user.jade
│ │ │ │ │ ├── head.jade
│ │ │ │ │ ├── layout.jade
│ │ │ │ │ ├── index.js
│ │ │ │ │ ├── index.jade
│ │ │ │ │ └── user.js
│ │ │ │ ├── index.js
│ │ │ │ ├── test.jade
│ │ │ │ ├── .npmignore
│ │ │ │ ├── lib
│ │ │ │ │ ├── self-closing.js
│ │ │ │ │ ├── inline-tags.js
│ │ │ │ │ ├── nodes
│ │ │ │ │ │ ├── node.js
│ │ │ │ │ │ ├── doctype.js
│ │ │ │ │ │ ├── index.js
│ │ │ │ │ │ ├── literal.js
│ │ │ │ │ │ ├── text.js
│ │ │ │ │ │ ├── comment.js
│ │ │ │ │ │ ├── block-comment.js
│ │ │ │ │ │ ├── each.js
│ │ │ │ │ │ ├── mixin.js
│ │ │ │ │ │ ├── code.js
│ │ │ │ │ │ ├── filter.js
│ │ │ │ │ │ ├── case.js
│ │ │ │ │ │ ├── attrs.js
│ │ │ │ │ │ ├── tag.js
│ │ │ │ │ │ └── block.js
│ │ │ │ │ ├── doctypes.js
│ │ │ │ │ ├── utils.js
│ │ │ │ │ └── filters.js
│ │ │ │ ├── package.json
│ │ │ │ ├── LICENSE
│ │ │ │ └── runtime.min.js
│ │ │ ├── growl
│ │ │ │ ├── test.js
│ │ │ │ └── History.md
│ │ │ └── diff
│ │ │ │ ├── style.css
│ │ │ │ ├── LICENSE
│ │ │ │ └── index.html
│ │ ├── .npmignore
│ │ ├── .travis.yml
│ │ ├── images
│ │ │ ├── ok.png
│ │ │ └── error.png
│ │ ├── index.js
│ │ ├── test.js
│ │ ├── component.json
│ │ ├── LICENSE
│ │ ├── bin
│ │ │ └── mocha
│ │ ├── Readme.md
│ │ ├── package.json
│ │ └── Makefile
│ ├── pegjs
│ │ ├── VERSION
│ │ ├── examples
│ │ │ └── arithmetics.pegjs
│ │ └── LICENSE
│ ├── .bin
│ │ ├── _mocha
│ │ ├── mocha
│ │ └── pegjs
│ └── chai
│ │ ├── index.js
│ │ ├── .npmignore
│ │ ├── lib
│ │ ├── chai
│ │ │ ├── interface
│ │ │ │ ├── expect.js
│ │ │ │ └── should.js
│ │ │ ├── utils
│ │ │ │ ├── getName.js
│ │ │ │ ├── getActual.js
│ │ │ │ ├── test.js
│ │ │ │ ├── getEnumerableProperties.js
│ │ │ │ ├── flag.js
│ │ │ │ ├── getProperties.js
│ │ │ │ ├── addMethod.js
│ │ │ │ ├── addProperty.js
│ │ │ │ ├── type.js
│ │ │ │ ├── objDisplay.js
│ │ │ │ ├── getMessage.js
│ │ │ │ ├── transferFlags.js
│ │ │ │ ├── overwriteMethod.js
│ │ │ │ ├── overwriteProperty.js
│ │ │ │ ├── index.js
│ │ │ │ ├── getPathValue.js
│ │ │ │ └── addChainableMethod.js
│ │ │ └── error.js
│ │ └── chai.js
│ │ └── README.md
├── test.js
├── pegSpec.js
├── roboParseSpec.js
└── notesSpec.js
├── index.html
├── arithmetic.peg
├── scheem.peg
├── lib
└── jasmine-1.3.1
│ └── MIT.LICENSE
├── SpecRunner.html
├── compileNotes.js
└── robo.peg
/spec/node_modules/mocha/lib/browser/fs.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/lib/browser/path.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/spec/node_modules/pegjs/VERSION:
--------------------------------------------------------------------------------
1 | 0.7.0
2 |
--------------------------------------------------------------------------------
/spec/node_modules/.bin/_mocha:
--------------------------------------------------------------------------------
1 | ../mocha/bin/_mocha
--------------------------------------------------------------------------------
/spec/node_modules/.bin/mocha:
--------------------------------------------------------------------------------
1 | ../mocha/bin/mocha
--------------------------------------------------------------------------------
/spec/node_modules/.bin/pegjs:
--------------------------------------------------------------------------------
1 | ../pegjs/bin/pegjs
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/.bin/jade:
--------------------------------------------------------------------------------
1 | ../jade/bin/jade
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/ms/.npmignore:
--------------------------------------------------------------------------------
1 | node_modules
2 |
--------------------------------------------------------------------------------
/spec/node_modules/chai/index.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./lib/chai');
2 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/mkdirp/.npmignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | npm-debug.log
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/mkdirp/.gitignore.orig:
--------------------------------------------------------------------------------
1 | node_modules/
2 | npm-debug.log
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/debug/.npmignore:
--------------------------------------------------------------------------------
1 | support
2 | test
3 | examples
4 | *.sock
5 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/.npmignore:
--------------------------------------------------------------------------------
1 | test
2 | examples
3 | *.sock
4 | lib-cov
5 | editors
6 | support
7 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js:
3 | - 0.4
4 | - 0.6
5 | - 0.8
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/commander/.npmignore:
--------------------------------------------------------------------------------
1 | support
2 | test
3 | examples
4 | *.sock
5 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/node_modules/mkdirp/.npmignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | npm-debug.log
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/commander/index.js:
--------------------------------------------------------------------------------
1 |
2 | module.exports = require('./lib/commander');
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/node_modules/mkdirp/.gitignore.orig:
--------------------------------------------------------------------------------
1 | node_modules/
2 | npm-debug.log
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/commander/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js:
3 | - 0.4
4 | - 0.6
5 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/mkdirp/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js:
3 | - 0.4
4 | - 0.6
5 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/images/ok.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gmx/proglang-stuff/master/spec/node_modules/mocha/images/ok.png
--------------------------------------------------------------------------------
/spec/node_modules/mocha/lib/browser/debug.js:
--------------------------------------------------------------------------------
1 |
2 | module.exports = function(type){
3 | return function(){
4 |
5 | }
6 | };
--------------------------------------------------------------------------------
/spec/node_modules/mocha/images/error.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gmx/proglang-stuff/master/spec/node_modules/mocha/images/error.png
--------------------------------------------------------------------------------
/spec/node_modules/mocha/index.js:
--------------------------------------------------------------------------------
1 |
2 | module.exports = process.env.COV
3 | ? require('./lib-cov/mocha')
4 | : require('./lib/mocha');
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/testing/user.jade:
--------------------------------------------------------------------------------
1 | h1 Tobi
2 | p Is a ferret
3 |
4 | ul
5 | li: a foo
6 | li: a bar
7 | li: a baz
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/mkdirp/.gitignore.rej:
--------------------------------------------------------------------------------
1 | --- /dev/null
2 | +++ .gitignore
3 | @@ -0,0 +1,2 @@
4 | +node_modules/
5 | +npm-debug.log
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/index.js:
--------------------------------------------------------------------------------
1 |
2 | module.exports = process.env.JADE_COV
3 | ? require('./lib-cov/jade')
4 | : require('./lib/jade');
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/test.jade:
--------------------------------------------------------------------------------
1 | p.
2 | This is a large
3 | body of text for
4 | this tag.
5 |
6 | Nothing too
7 | exciting.
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/commander/Makefile:
--------------------------------------------------------------------------------
1 |
2 | TESTS = $(shell find test/test.*.js)
3 |
4 | test:
5 | @./test/run $(TESTS)
6 |
7 | .PHONY: test
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/testing/head.jade:
--------------------------------------------------------------------------------
1 | head
2 | script(src='/jquery.js')
3 | yield
4 | if false
5 | script(src='/jquery.ui.js')
6 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/node_modules/mkdirp/.gitignore.rej:
--------------------------------------------------------------------------------
1 | --- /dev/null
2 | +++ .gitignore
3 | @@ -0,0 +1,2 @@
4 | +node_modules/
5 | +npm-debug.log
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/testing/layout.jade:
--------------------------------------------------------------------------------
1 | html
2 | include head
3 | script(src='/caustic.js')
4 | script(src='/app.js')
5 | body
6 | block content
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/ms/Makefile:
--------------------------------------------------------------------------------
1 |
2 | test:
3 | @./node_modules/.bin/mocha test/test.js
4 |
5 | test-browser:
6 | ./node_modules/.bin/serve test/
7 |
8 | .PHONY: test
9 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/debug/index.js:
--------------------------------------------------------------------------------
1 | if ('undefined' == typeof window) {
2 | module.exports = require('./lib/debug');
3 | } else {
4 | module.exports = require('./debug');
5 | }
6 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/lib/browser/tty.js:
--------------------------------------------------------------------------------
1 |
2 | exports.isatty = function(){
3 | return true;
4 | };
5 |
6 | exports.getWindowSize = function(){
7 | return [window.innerHeight, window.innerWidth];
8 | };
--------------------------------------------------------------------------------
/spec/node_modules/mocha/lib/interfaces/index.js:
--------------------------------------------------------------------------------
1 |
2 | exports.bdd = require('./bdd');
3 | exports.tdd = require('./tdd');
4 | exports.qunit = require('./qunit');
5 | exports.exports = require('./exports');
6 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/mkdirp/examples/pow.js:
--------------------------------------------------------------------------------
1 | var mkdirp = require('mkdirp');
2 |
3 | mkdirp('/tmp/foo/bar/baz', function (err) {
4 | if (err) console.error(err)
5 | else console.log('pow!')
6 | });
7 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/ms/component.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "ms",
3 | "repo": "guille/ms.js",
4 | "description": "ms parsing / formatting",
5 | "keywords": ["ms", "parse", "format"],
6 | "main": "ms.js"
7 | }
--------------------------------------------------------------------------------
/spec/node_modules/chai/.npmignore:
--------------------------------------------------------------------------------
1 | .git*
2 | docs/
3 | test/
4 | support/
5 | component.json
6 | components/
7 | build/
8 | lib-cov/
9 | coverage.html
10 | .travis.yml
11 | .mailmap
12 | Makefile
13 | *.swp
14 | .DS_Store
15 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/mkdirp/examples/pow.js.orig:
--------------------------------------------------------------------------------
1 | var mkdirp = require('mkdirp');
2 |
3 | mkdirp('/tmp/foo/bar/baz', 0755, function (err) {
4 | if (err) console.error(err)
5 | else console.log('pow!')
6 | });
7 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/node_modules/mkdirp/examples/pow.js:
--------------------------------------------------------------------------------
1 | var mkdirp = require('mkdirp');
2 |
3 | mkdirp('/tmp/foo/bar/baz', function (err) {
4 | if (err) console.error(err)
5 | else console.log('pow!')
6 | });
7 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/node_modules/mkdirp/examples/pow.js.orig:
--------------------------------------------------------------------------------
1 | var mkdirp = require('mkdirp');
2 |
3 | mkdirp('/tmp/foo/bar/baz', 0755, function (err) {
4 | if (err) console.error(err)
5 | else console.log('pow!')
6 | });
7 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/test.js:
--------------------------------------------------------------------------------
1 |
2 | describe('somethinf', function(){
3 | it('should fail', function(){
4 | test()
5 | })
6 |
7 | it('should pass', function(){
8 |
9 | })
10 |
11 | it('should pass again', function(){
12 |
13 | })
14 | })
15 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/.npmignore:
--------------------------------------------------------------------------------
1 | test
2 | support
3 | benchmarks
4 | examples
5 | lib-cov
6 | coverage.html
7 | .gitmodules
8 | .travis.yml
9 | History.md
10 | Readme.md
11 | Makefile
12 | test/
13 | support/
14 | benchmarks/
15 | examples/
16 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/debug/example/wildcards.js:
--------------------------------------------------------------------------------
1 |
2 | var debug = {
3 | foo: require('../')('test:foo'),
4 | bar: require('../')('test:bar'),
5 | baz: require('../')('test:baz')
6 | };
7 |
8 | debug.foo('foo')
9 | debug.bar('bar')
10 | debug.baz('baz')
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/debug/component.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "debug",
3 | "repo": "visionmedia/debug",
4 | "description": "small debugging utility",
5 | "version": "0.7.2",
6 | "keywords": ["debug", "log", "debugger"],
7 | "scripts": ["index.js", "debug.js"],
8 | "dependencies": {}
9 | }
10 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/testing/index.js:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * Module dependencies.
4 | */
5 |
6 | var jade = require('../');
7 |
8 | jade.renderFile('testing/index.jade', { pretty: true, debug: true, compileDebug: false }, function(err, str){
9 | if (err) throw err;
10 | console.log(str);
11 | });
--------------------------------------------------------------------------------
/spec/test.js:
--------------------------------------------------------------------------------
1 | var assert = require("assert");
2 |
3 | describe('Array', function(){
4 | describe('#indexOf()', function(){
5 | it('should return -1 when the value is not present', function(){
6 | assert.equal(-1, [1,2,3].indexOf(5));
7 | assert.equal(-1, [1,2,3].indexOf(0));
8 | });
9 | });
10 | });
--------------------------------------------------------------------------------
/spec/node_modules/chai/lib/chai/interface/expect.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * chai
3 | * Copyright(c) 2011-2013 Jake Luer
4 | * MIT Licensed
5 | */
6 |
7 | module.exports = function (chai, util) {
8 | chai.expect = function (val, message) {
9 | return new chai.Assertion(val, message);
10 | };
11 | };
12 |
13 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/lib/self-closing.js:
--------------------------------------------------------------------------------
1 |
2 | /*!
3 | * Jade - self closing tags
4 | * Copyright(c) 2010 TJ Holowaychuk
5 | * MIT Licensed
6 | */
7 |
8 | module.exports = [
9 | 'meta'
10 | , 'img'
11 | , 'link'
12 | , 'input'
13 | , 'source'
14 | , 'area'
15 | , 'base'
16 | , 'col'
17 | , 'br'
18 | , 'hr'
19 | ];
--------------------------------------------------------------------------------
/spec/node_modules/mocha/component.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "mocha",
3 | "version": "1.8.1",
4 | "repo": "visionmedia/mocha",
5 | "description": "simple, flexible, fun test framework",
6 | "keywords": [
7 | "mocha",
8 | "test",
9 | "bdd",
10 | "tdd",
11 | "tap"
12 | ],
13 | "main": "mocha.js",
14 | "scripts": ["mocha.js"],
15 | "styles": ["mocha.css"]
16 | }
17 |
--------------------------------------------------------------------------------
/spec/pegSpec.js:
--------------------------------------------------------------------------------
1 | var PEG = require('pegjs');
2 | var assert = require('assert');
3 | var fs = require('fs'); // for loading files
4 |
5 | // Read file contents
6 | var data = fs.readFileSync('../scheem.peg', 'utf-8');
7 | // Show the PEG grammar file
8 | console.log(data);
9 | // Create my parser
10 | var parse = PEG.buildParser(data).parse;
11 | // Do a test
12 | assert.deepEqual( parse("(a b c)"), ["a", "b", "c"] );
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/debug/example/app.js:
--------------------------------------------------------------------------------
1 |
2 | var debug = require('../')('http')
3 | , http = require('http')
4 | , name = 'My App';
5 |
6 | // fake app
7 |
8 | debug('booting %s', name);
9 |
10 | http.createServer(function(req, res){
11 | debug(req.method + ' ' + req.url);
12 | res.end('hello\n');
13 | }).listen(3000, function(){
14 | debug('listening');
15 | });
16 |
17 | // fake worker of some kind
18 |
19 | require('./worker');
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/testing/index.jade:
--------------------------------------------------------------------------------
1 |
2 | tag = 'p'
3 | foo = 'bar'
4 |
5 | #{tag} value
6 | #{tag}(foo='bar') value
7 | #{foo ? 'a' : 'li'}(something) here
8 |
9 | mixin item(icon)
10 | li
11 | if attributes.href
12 | a(attributes)
13 | img.icon(src=icon)
14 | block
15 | else
16 | span(attributes)
17 | img.icon(src=icon)
18 | block
19 |
20 | ul
21 | +item('contact') Contact
22 | +item(href='/contact') Contact
23 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/lib/inline-tags.js:
--------------------------------------------------------------------------------
1 |
2 | /*!
3 | * Jade - inline tags
4 | * Copyright(c) 2010 TJ Holowaychuk
5 | * MIT Licensed
6 | */
7 |
8 | module.exports = [
9 | 'a'
10 | , 'abbr'
11 | , 'acronym'
12 | , 'b'
13 | , 'br'
14 | , 'code'
15 | , 'em'
16 | , 'font'
17 | , 'i'
18 | , 'img'
19 | , 'ins'
20 | , 'kbd'
21 | , 'map'
22 | , 'samp'
23 | , 'small'
24 | , 'span'
25 | , 'strong'
26 | , 'sub'
27 | , 'sup'
28 | ];
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/lib/nodes/node.js:
--------------------------------------------------------------------------------
1 |
2 | /*!
3 | * Jade - nodes - Node
4 | * Copyright(c) 2010 TJ Holowaychuk
5 | * MIT Licensed
6 | */
7 |
8 | /**
9 | * Initialize a `Node`.
10 | *
11 | * @api public
12 | */
13 |
14 | var Node = module.exports = function Node(){};
15 |
16 | /**
17 | * Clone this node (return itself)
18 | *
19 | * @return {Node}
20 | * @api private
21 | */
22 |
23 | Node.prototype.clone = function(){
24 | return this;
25 | };
26 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/lib/template.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Mocha
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/lib/reporters/templates/menu.jade:
--------------------------------------------------------------------------------
1 | #menu
2 | li
3 | a(href='#overview') overview
4 | for file in cov.files
5 | li
6 | span.cov(class=coverageClass(file.coverage)) #{file.coverage | 0}
7 | a(href='##{file.filename}')
8 | segments = file.filename.split('/')
9 | basename = segments.pop()
10 | if segments.length
11 | span.dirname= segments.join('/') + '/'
12 | span.basename= basename
13 | a#logo(href='http://visionmedia.github.com/mocha/') m
--------------------------------------------------------------------------------
/spec/node_modules/chai/lib/chai/utils/getName.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * Chai - getName utility
3 | * Copyright(c) 2012-2013 Jake Luer
4 | * MIT Licensed
5 | */
6 |
7 | /**
8 | * # getName(func)
9 | *
10 | * Gets the name of a function, in a cross-browser way.
11 | *
12 | * @param {Function} a function (usually a constructor)
13 | */
14 |
15 | module.exports = function (func) {
16 | if (func.name) return func.name;
17 |
18 | var match = /^\s?function ([^(]*)\(/.exec(func);
19 | return match && match[1] ? match[1] : "";
20 | };
21 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/mkdirp/examples/pow.js.rej:
--------------------------------------------------------------------------------
1 | --- examples/pow.js
2 | +++ examples/pow.js
3 | @@ -1,6 +1,15 @@
4 | -var mkdirp = require('mkdirp').mkdirp;
5 | +var mkdirp = require('../').mkdirp,
6 | + mkdirpSync = require('../').mkdirpSync;
7 |
8 | mkdirp('/tmp/foo/bar/baz', 0755, function (err) {
9 | if (err) console.error(err)
10 | else console.log('pow!')
11 | });
12 | +
13 | +try {
14 | + mkdirpSync('/tmp/bar/foo/baz', 0755);
15 | + console.log('double pow!');
16 | +}
17 | +catch (ex) {
18 | + console.log(ex);
19 | +}
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/node_modules/mkdirp/examples/pow.js.rej:
--------------------------------------------------------------------------------
1 | --- examples/pow.js
2 | +++ examples/pow.js
3 | @@ -1,6 +1,15 @@
4 | -var mkdirp = require('mkdirp').mkdirp;
5 | +var mkdirp = require('../').mkdirp,
6 | + mkdirpSync = require('../').mkdirpSync;
7 |
8 | mkdirp('/tmp/foo/bar/baz', 0755, function (err) {
9 | if (err) console.error(err)
10 | else console.log('pow!')
11 | });
12 | +
13 | +try {
14 | + mkdirpSync('/tmp/bar/foo/baz', 0755);
15 | + console.log('double pow!');
16 | +}
17 | +catch (ex) {
18 | + console.log(ex);
19 | +}
--------------------------------------------------------------------------------
/spec/node_modules/chai/lib/chai/utils/getActual.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * Chai - getActual utility
3 | * Copyright(c) 2012-2013 Jake Luer
4 | * MIT Licensed
5 | */
6 |
7 | /**
8 | * # getActual(object, [actual])
9 | *
10 | * Returns the `actual` value for an Assertion
11 | *
12 | * @param {Object} object (constructed Assertion)
13 | * @param {Arguments} chai.Assertion.prototype.assert arguments
14 | */
15 |
16 | module.exports = function (obj, args) {
17 | var actual = args[4];
18 | return 'undefined' !== typeof actual ? actual : obj._obj;
19 | };
20 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/debug/example/worker.js:
--------------------------------------------------------------------------------
1 |
2 | // DEBUG=* node example/worker
3 | // DEBUG=worker:* node example/worker
4 | // DEBUG=worker:a node example/worker
5 | // DEBUG=worker:b node example/worker
6 |
7 | var a = require('../')('worker:a')
8 | , b = require('../')('worker:b');
9 |
10 | function work() {
11 | a('doing lots of uninteresting work');
12 | setTimeout(work, Math.random() * 1000);
13 | }
14 |
15 | work();
16 |
17 | function workb() {
18 | b('doing some work');
19 | setTimeout(workb, Math.random() * 2000);
20 | }
21 |
22 | workb();
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/mkdirp/test/root.js:
--------------------------------------------------------------------------------
1 | var mkdirp = require('../');
2 | var path = require('path');
3 | var fs = require('fs');
4 | var test = require('tap').test;
5 |
6 | test('root', function (t) {
7 | // '/' on unix, 'c:/' on windows.
8 | var file = path.resolve('/');
9 |
10 | mkdirp(file, 0755, function (err) {
11 | if (err) throw err
12 | fs.stat(file, function (er, stat) {
13 | if (er) throw er
14 | t.ok(stat.isDirectory(), 'target is a directory');
15 | t.end();
16 | })
17 | });
18 | });
19 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/ms/History.md:
--------------------------------------------------------------------------------
1 |
2 | 0.3.0 / 2012-09-07
3 | ==================
4 |
5 | * fix `ms()` [visionmedia]
6 |
7 | 0.2.0 / 2012-09-03
8 | ==================
9 |
10 | * add component.json [visionmedia]
11 | * add days support [visionmedia]
12 | * add hours support [visionmedia]
13 | * add minutes support [visionmedia]
14 | * add seconds support [visionmedia]
15 | * add ms string support [visionmedia]
16 | * refactor tests to facilitate ms(number) [visionmedia]
17 |
18 | 0.1.0 / 2012-03-07
19 | ==================
20 |
21 | * Initial release
22 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/debug/example/browser.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | debug()
4 |
5 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/lib/nodes/doctype.js:
--------------------------------------------------------------------------------
1 |
2 | /*!
3 | * Jade - nodes - Doctype
4 | * Copyright(c) 2010 TJ Holowaychuk
5 | * MIT Licensed
6 | */
7 |
8 | /**
9 | * Module dependencies.
10 | */
11 |
12 | var Node = require('./node');
13 |
14 | /**
15 | * Initialize a `Doctype` with the given `val`.
16 | *
17 | * @param {String} val
18 | * @api public
19 | */
20 |
21 | var Doctype = module.exports = function Doctype(val) {
22 | this.val = val;
23 | };
24 |
25 | /**
26 | * Inherit from `Node`.
27 | */
28 |
29 | Doctype.prototype.__proto__ = Node.prototype;
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/ms/test/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ms.js tests
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/arithmetic.peg:
--------------------------------------------------------------------------------
1 | start =
2 | comma
3 |
4 | comma =
5 | left:additive "," right:comma
6 | {return {tag: ",", left:left, right:right}; }
7 | /additive
8 |
9 | additive =
10 | left:multiplicative "+" right:additive
11 | { return {tag: "+", left:left, right:right}; }
12 | / multiplicative
13 |
14 | multiplicative =
15 | left:primary "*" right:multiplicative
16 | { return {tag: "*", left:left, right:right}; }
17 | / primary
18 |
19 | primary =
20 | integer
21 | / "(" comma:comma ")"
22 | { return comma; }
23 |
24 | integer =
25 | digits:[0-9]+
26 | { return parseInt(digits.join(""), 10); }
--------------------------------------------------------------------------------
/spec/node_modules/mocha/lib/test.js:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * Module dependencies.
4 | */
5 |
6 | var Runnable = require('./runnable');
7 |
8 | /**
9 | * Expose `Test`.
10 | */
11 |
12 | module.exports = Test;
13 |
14 | /**
15 | * Initialize a new `Test` with the given `title` and callback `fn`.
16 | *
17 | * @param {String} title
18 | * @param {Function} fn
19 | * @api private
20 | */
21 |
22 | function Test(title, fn) {
23 | Runnable.call(this, title, fn);
24 | this.pending = !fn;
25 | this.type = 'test';
26 | }
27 |
28 | /**
29 | * Inherit from `Runnable.prototype`.
30 | */
31 |
32 | Test.prototype.__proto__ = Runnable.prototype;
33 |
--------------------------------------------------------------------------------
/spec/node_modules/chai/lib/chai/utils/test.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * Chai - test utility
3 | * Copyright(c) 2012-2013 Jake Luer
4 | * MIT Licensed
5 | */
6 |
7 | /*!
8 | * Module dependancies
9 | */
10 |
11 | var flag = require('./flag');
12 |
13 | /**
14 | * # test(object, expression)
15 | *
16 | * Test and object for expression.
17 | *
18 | * @param {Object} object (constructed Assertion)
19 | * @param {Arguments} chai.Assertion.prototype.assert arguments
20 | */
21 |
22 | module.exports = function (obj, args) {
23 | var negate = flag(obj, 'negate')
24 | , expr = args[0];
25 | return negate ? !expr : expr;
26 | };
27 |
--------------------------------------------------------------------------------
/spec/node_modules/pegjs/examples/arithmetics.pegjs:
--------------------------------------------------------------------------------
1 | /*
2 | * Classic example grammar, which recognizes simple arithmetic expressions like
3 | * "2*(3+4)". The parser generated from this grammar then computes their value.
4 | */
5 |
6 | start
7 | = additive
8 |
9 | additive
10 | = left:multiplicative "+" right:additive { return left + right; }
11 | / multiplicative
12 |
13 | multiplicative
14 | = left:primary "*" right:multiplicative { return left * right; }
15 | / primary
16 |
17 | primary
18 | = integer
19 | / "(" additive:additive ")" { return additive; }
20 |
21 | integer "integer"
22 | = digits:[0-9]+ { return parseInt(digits.join(""), 10); }
23 |
--------------------------------------------------------------------------------
/spec/node_modules/chai/lib/chai/utils/getEnumerableProperties.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * Chai - getEnumerableProperties utility
3 | * Copyright(c) 2012-2013 Jake Luer
4 | * MIT Licensed
5 | */
6 |
7 | /**
8 | * ### .getEnumerableProperties(object)
9 | *
10 | * This allows the retrieval of enumerable property names of an object,
11 | * inherited or not.
12 | *
13 | * @param {Object} object
14 | * @returns {Array}
15 | * @name getEnumerableProperties
16 | * @api public
17 | */
18 |
19 | module.exports = function getEnumerableProperties(object) {
20 | var result = [];
21 | for (var name in object) {
22 | result.push(name);
23 | }
24 | return result;
25 | };
26 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/lib/nodes/index.js:
--------------------------------------------------------------------------------
1 |
2 | /*!
3 | * Jade - nodes
4 | * Copyright(c) 2010 TJ Holowaychuk
5 | * MIT Licensed
6 | */
7 |
8 | exports.Node = require('./node');
9 | exports.Tag = require('./tag');
10 | exports.Code = require('./code');
11 | exports.Each = require('./each');
12 | exports.Case = require('./case');
13 | exports.Text = require('./text');
14 | exports.Block = require('./block');
15 | exports.Mixin = require('./mixin');
16 | exports.Filter = require('./filter');
17 | exports.Comment = require('./comment');
18 | exports.Literal = require('./literal');
19 | exports.BlockComment = require('./block-comment');
20 | exports.Doctype = require('./doctype');
21 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/lib/nodes/literal.js:
--------------------------------------------------------------------------------
1 |
2 | /*!
3 | * Jade - nodes - Literal
4 | * Copyright(c) 2010 TJ Holowaychuk
5 | * MIT Licensed
6 | */
7 |
8 | /**
9 | * Module dependencies.
10 | */
11 |
12 | var Node = require('./node');
13 |
14 | /**
15 | * Initialize a `Literal` node with the given `str.
16 | *
17 | * @param {String} str
18 | * @api public
19 | */
20 |
21 | var Literal = module.exports = function Literal(str) {
22 | this.str = str
23 | .replace(/\\/g, "\\\\")
24 | .replace(/\n|\r\n/g, "\\n")
25 | .replace(/'/g, "\\'");
26 | };
27 |
28 | /**
29 | * Inherit from `Node`.
30 | */
31 |
32 | Literal.prototype.__proto__ = Node.prototype;
33 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/lib/nodes/text.js:
--------------------------------------------------------------------------------
1 |
2 | /*!
3 | * Jade - nodes - Text
4 | * Copyright(c) 2010 TJ Holowaychuk
5 | * MIT Licensed
6 | */
7 |
8 | /**
9 | * Module dependencies.
10 | */
11 |
12 | var Node = require('./node');
13 |
14 | /**
15 | * Initialize a `Text` node with optional `line`.
16 | *
17 | * @param {String} line
18 | * @api public
19 | */
20 |
21 | var Text = module.exports = function Text(line) {
22 | this.val = '';
23 | if ('string' == typeof line) this.val = line;
24 | };
25 |
26 | /**
27 | * Inherit from `Node`.
28 | */
29 |
30 | Text.prototype.__proto__ = Node.prototype;
31 |
32 | /**
33 | * Flag as text.
34 | */
35 |
36 | Text.prototype.isText = true;
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/lib/nodes/comment.js:
--------------------------------------------------------------------------------
1 |
2 | /*!
3 | * Jade - nodes - Comment
4 | * Copyright(c) 2010 TJ Holowaychuk
5 | * MIT Licensed
6 | */
7 |
8 | /**
9 | * Module dependencies.
10 | */
11 |
12 | var Node = require('./node');
13 |
14 | /**
15 | * Initialize a `Comment` with the given `val`, optionally `buffer`,
16 | * otherwise the comment may render in the output.
17 | *
18 | * @param {String} val
19 | * @param {Boolean} buffer
20 | * @api public
21 | */
22 |
23 | var Comment = module.exports = function Comment(val, buffer) {
24 | this.val = val;
25 | this.buffer = buffer;
26 | };
27 |
28 | /**
29 | * Inherit from `Node`.
30 | */
31 |
32 | Comment.prototype.__proto__ = Node.prototype;
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/lib/nodes/block-comment.js:
--------------------------------------------------------------------------------
1 |
2 | /*!
3 | * Jade - nodes - BlockComment
4 | * Copyright(c) 2010 TJ Holowaychuk
5 | * MIT Licensed
6 | */
7 |
8 | /**
9 | * Module dependencies.
10 | */
11 |
12 | var Node = require('./node');
13 |
14 | /**
15 | * Initialize a `BlockComment` with the given `block`.
16 | *
17 | * @param {String} val
18 | * @param {Block} block
19 | * @param {Boolean} buffer
20 | * @api public
21 | */
22 |
23 | var BlockComment = module.exports = function BlockComment(val, block, buffer) {
24 | this.block = block;
25 | this.val = val;
26 | this.buffer = buffer;
27 | };
28 |
29 | /**
30 | * Inherit from `Node`.
31 | */
32 |
33 | BlockComment.prototype.__proto__ = Node.prototype;
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/lib/nodes/each.js:
--------------------------------------------------------------------------------
1 |
2 | /*!
3 | * Jade - nodes - Each
4 | * Copyright(c) 2010 TJ Holowaychuk
5 | * MIT Licensed
6 | */
7 |
8 | /**
9 | * Module dependencies.
10 | */
11 |
12 | var Node = require('./node');
13 |
14 | /**
15 | * Initialize an `Each` node, representing iteration
16 | *
17 | * @param {String} obj
18 | * @param {String} val
19 | * @param {String} key
20 | * @param {Block} block
21 | * @api public
22 | */
23 |
24 | var Each = module.exports = function Each(obj, val, key, block) {
25 | this.obj = obj;
26 | this.val = val;
27 | this.key = key;
28 | this.block = block;
29 | };
30 |
31 | /**
32 | * Inherit from `Node`.
33 | */
34 |
35 | Each.prototype.__proto__ = Node.prototype;
--------------------------------------------------------------------------------
/spec/node_modules/mocha/lib/reporters/index.js:
--------------------------------------------------------------------------------
1 |
2 | exports.Base = require('./base');
3 | exports.Dot = require('./dot');
4 | exports.Doc = require('./doc');
5 | exports.TAP = require('./tap');
6 | exports.JSON = require('./json');
7 | exports.HTML = require('./html');
8 | exports.List = require('./list');
9 | exports.Min = require('./min');
10 | exports.Spec = require('./spec');
11 | exports.Nyan = require('./nyan');
12 | exports.XUnit = require('./xunit');
13 | exports.Markdown = require('./markdown');
14 | exports.Progress = require('./progress');
15 | exports.Landing = require('./landing');
16 | exports.JSONCov = require('./json-cov');
17 | exports.HTMLCov = require('./html-cov');
18 | exports.JSONStream = require('./json-stream');
19 | exports.Teamcity = require('./teamcity');
20 |
--------------------------------------------------------------------------------
/scheem.peg:
--------------------------------------------------------------------------------
1 | start =
2 | space* expr:quotExpr space*
3 | {return expr;}
4 |
5 | quotExpr =
6 | "'" expr:expression
7 | { return "(quote " + expr + ")"; }
8 | /expression
9 |
10 | expression =
11 | quotAtom
12 | /"(" space* first:quotExpr rest:spacedExpr* space*")"
13 | { return [first].concat(rest) ;}
14 |
15 | validchar
16 | = [0-9a-zA-Z_?!+\-=@#$%^&*/.]
17 |
18 | quotAtom =
19 | "'" atom:atom
20 | {return "(quote " + atom + ")" ; }
21 | /atom
22 |
23 | atom =
24 | chars:validchar+
25 | { return chars.join(""); }
26 |
27 | space =
28 | " "
29 | /"\n"
30 | /"\t"
31 | /comment
32 |
33 | comment =
34 | ";;" [^\n\r]*
35 | { return; }
36 |
37 | spacedExpr =
38 | space+ expr:quotExpr
39 | { return expr; }
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/lib/nodes/mixin.js:
--------------------------------------------------------------------------------
1 |
2 | /*!
3 | * Jade - nodes - Mixin
4 | * Copyright(c) 2010 TJ Holowaychuk
5 | * MIT Licensed
6 | */
7 |
8 | /**
9 | * Module dependencies.
10 | */
11 |
12 | var Attrs = require('./attrs');
13 |
14 | /**
15 | * Initialize a new `Mixin` with `name` and `block`.
16 | *
17 | * @param {String} name
18 | * @param {String} args
19 | * @param {Block} block
20 | * @api public
21 | */
22 |
23 | var Mixin = module.exports = function Mixin(name, args, block, call){
24 | this.name = name;
25 | this.args = args;
26 | this.block = block;
27 | this.attrs = [];
28 | this.call = call;
29 | };
30 |
31 | /**
32 | * Inherit from `Attrs`.
33 | */
34 |
35 | Mixin.prototype.__proto__ = Attrs.prototype;
36 |
37 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/ms/README.md:
--------------------------------------------------------------------------------
1 | # ms.js: miliseconds conversion utility
2 |
3 | ```js
4 | ms('1d') // 86400000
5 | ms('10h') // 36000000
6 | ms('2h') // 7200000
7 | ms('1m') // 60000
8 | ms('5s') // 5000
9 | ms('100') // 100
10 | ms(100) // 100
11 | ```
12 |
13 | ```js
14 | ms(60000) // "1 minute"
15 | ms(2 * 60000) // "2 minutes"
16 | ms(ms('10 hours')) // "10 hours"
17 | ```
18 |
19 | - Node/Browser compatible. Published as `ms` in NPM.
20 | - If a number is supplied to `ms`, it returns it immediately.
21 | - If a string that contains the number is supplied, it returns it as
22 | a number (e.g: it returns `100` for `'100'`).
23 | - If you pass a string with a number and a valid unit, the number of
24 | equivalent ms is returned.
25 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/lib/reporters/min.js:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * Module dependencies.
4 | */
5 |
6 | var Base = require('./base');
7 |
8 | /**
9 | * Expose `Min`.
10 | */
11 |
12 | exports = module.exports = Min;
13 |
14 | /**
15 | * Initialize a new `Min` minimal test reporter (best used with --watch).
16 | *
17 | * @param {Runner} runner
18 | * @api public
19 | */
20 |
21 | function Min(runner) {
22 | Base.call(this, runner);
23 |
24 | runner.on('start', function(){
25 | // clear screen
26 | process.stdout.write('\u001b[2J');
27 | // set cursor position
28 | process.stdout.write('\u001b[1;3H');
29 | });
30 |
31 | runner.on('end', this.epilogue.bind(this));
32 | }
33 |
34 | /**
35 | * Inherit from `Base.prototype`.
36 | */
37 |
38 | Min.prototype.__proto__ = Base.prototype;
--------------------------------------------------------------------------------
/spec/node_modules/mocha/lib/reporters/templates/script.html:
--------------------------------------------------------------------------------
1 |
35 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/lib/nodes/code.js:
--------------------------------------------------------------------------------
1 |
2 | /*!
3 | * Jade - nodes - Code
4 | * Copyright(c) 2010 TJ Holowaychuk
5 | * MIT Licensed
6 | */
7 |
8 | /**
9 | * Module dependencies.
10 | */
11 |
12 | var Node = require('./node');
13 |
14 | /**
15 | * Initialize a `Code` node with the given code `val`.
16 | * Code may also be optionally buffered and escaped.
17 | *
18 | * @param {String} val
19 | * @param {Boolean} buffer
20 | * @param {Boolean} escape
21 | * @api public
22 | */
23 |
24 | var Code = module.exports = function Code(val, buffer, escape) {
25 | this.val = val;
26 | this.buffer = buffer;
27 | this.escape = escape;
28 | if (val.match(/^ *else/)) this.debug = false;
29 | };
30 |
31 | /**
32 | * Inherit from `Node`.
33 | */
34 |
35 | Code.prototype.__proto__ = Node.prototype;
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/lib/nodes/filter.js:
--------------------------------------------------------------------------------
1 |
2 | /*!
3 | * Jade - nodes - Filter
4 | * Copyright(c) 2010 TJ Holowaychuk
5 | * MIT Licensed
6 | */
7 |
8 | /**
9 | * Module dependencies.
10 | */
11 |
12 | var Node = require('./node')
13 | , Block = require('./block');
14 |
15 | /**
16 | * Initialize a `Filter` node with the given
17 | * filter `name` and `block`.
18 | *
19 | * @param {String} name
20 | * @param {Block|Node} block
21 | * @api public
22 | */
23 |
24 | var Filter = module.exports = function Filter(name, block, attrs) {
25 | this.name = name;
26 | this.block = block;
27 | this.attrs = attrs;
28 | this.isASTFilter = !block.nodes.every(function(node){ return node.isText });
29 | };
30 |
31 | /**
32 | * Inherit from `Node`.
33 | */
34 |
35 | Filter.prototype.__proto__ = Node.prototype;
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/lib/nodes/case.js:
--------------------------------------------------------------------------------
1 |
2 | /*!
3 | * Jade - nodes - Case
4 | * Copyright(c) 2010 TJ Holowaychuk
5 | * MIT Licensed
6 | */
7 |
8 | /**
9 | * Module dependencies.
10 | */
11 |
12 | var Node = require('./node');
13 |
14 | /**
15 | * Initialize a new `Case` with `expr`.
16 | *
17 | * @param {String} expr
18 | * @api public
19 | */
20 |
21 | var Case = exports = module.exports = function Case(expr, block){
22 | this.expr = expr;
23 | this.block = block;
24 | };
25 |
26 | /**
27 | * Inherit from `Node`.
28 | */
29 |
30 | Case.prototype.__proto__ = Node.prototype;
31 |
32 | var When = exports.When = function When(expr, block){
33 | this.expr = expr;
34 | this.block = block;
35 | this.debug = false;
36 | };
37 |
38 | /**
39 | * Inherit from `Node`.
40 | */
41 |
42 | When.prototype.__proto__ = Node.prototype;
43 |
44 |
--------------------------------------------------------------------------------
/spec/node_modules/chai/lib/chai/utils/flag.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * Chai - flag utility
3 | * Copyright(c) 2012-2013 Jake Luer
4 | * MIT Licensed
5 | */
6 |
7 | /**
8 | * ### flag(object ,key, [value])
9 | *
10 | * Get or set a flag value on an object. If a
11 | * value is provided it will be set, else it will
12 | * return the currently set value or `undefined` if
13 | * the value is not set.
14 | *
15 | * utils.flag(this, 'foo', 'bar'); // setter
16 | * utils.flag(this, 'foo'); // getter, returns `bar`
17 | *
18 | * @param {Object} object (constructed Assertion
19 | * @param {String} key
20 | * @param {Mixed} value (optional)
21 | * @name flag
22 | * @api private
23 | */
24 |
25 | module.exports = function (obj, key, value) {
26 | var flags = obj.__flags || (obj.__flags = Object.create(null));
27 | if (arguments.length === 3) {
28 | flags[key] = value;
29 | } else {
30 | return flags[key];
31 | }
32 | };
33 |
--------------------------------------------------------------------------------
/spec/node_modules/chai/lib/chai/utils/getProperties.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * Chai - getProperties utility
3 | * Copyright(c) 2012-2013 Jake Luer
4 | * MIT Licensed
5 | */
6 |
7 | /**
8 | * ### .getProperties(object)
9 | *
10 | * This allows the retrieval of property names of an object, enumerable or not,
11 | * inherited or not.
12 | *
13 | * @param {Object} object
14 | * @returns {Array}
15 | * @name getProperties
16 | * @api public
17 | */
18 |
19 | module.exports = function getProperties(object) {
20 | var result = Object.getOwnPropertyNames(subject);
21 |
22 | function addProperty(property) {
23 | if (result.indexOf(property) === -1) {
24 | result.push(property);
25 | }
26 | }
27 |
28 | var proto = Object.getPrototypeOf(subject);
29 | while (proto !== null) {
30 | Object.getOwnPropertyNames(proto).forEach(addProperty);
31 | proto = Object.getPrototypeOf(proto);
32 | }
33 |
34 | return result;
35 | };
36 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/lib/hook.js:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * Module dependencies.
4 | */
5 |
6 | var Runnable = require('./runnable');
7 |
8 | /**
9 | * Expose `Hook`.
10 | */
11 |
12 | module.exports = Hook;
13 |
14 | /**
15 | * Initialize a new `Hook` with the given `title` and callback `fn`.
16 | *
17 | * @param {String} title
18 | * @param {Function} fn
19 | * @api private
20 | */
21 |
22 | function Hook(title, fn) {
23 | Runnable.call(this, title, fn);
24 | this.type = 'hook';
25 | }
26 |
27 | /**
28 | * Inherit from `Runnable.prototype`.
29 | */
30 |
31 | Hook.prototype.__proto__ = Runnable.prototype;
32 |
33 | /**
34 | * Get or set the test `err`.
35 | *
36 | * @param {Error} err
37 | * @return {Error}
38 | * @api public
39 | */
40 |
41 | Hook.prototype.error = function(err){
42 | if (0 == arguments.length) {
43 | var err = this._error;
44 | this._error = null;
45 | return err;
46 | }
47 |
48 | this._error = err;
49 | };
50 |
51 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/testing/user.js:
--------------------------------------------------------------------------------
1 | function anonymous(locals, attrs, escape, rethrow) {
2 | var attrs = jade.attrs, escape = jade.escape, rethrow = jade.rethrow;
3 | var __jade = [{ lineno: 1, filename: "testing/user.jade" }];
4 | try {
5 | var buf = [];
6 | with (locals || {}) {
7 | var interp;
8 | __jade.unshift({ lineno: 1, filename: __jade[0].filename });
9 | __jade.unshift({ lineno: 1, filename: __jade[0].filename });
10 | buf.push('Tobi');
11 | __jade.unshift({ lineno: undefined, filename: __jade[0].filename });
12 | __jade.shift();
13 | buf.push('
');
14 | __jade.shift();
15 | __jade.unshift({ lineno: 2, filename: __jade[0].filename });
16 | buf.push('Is a ferret');
17 | __jade.unshift({ lineno: undefined, filename: __jade[0].filename });
18 | __jade.shift();
19 | buf.push('
');
20 | __jade.shift();
21 | __jade.shift();
22 | }
23 | return buf.join("");
24 | } catch (err) {
25 | rethrow(err, __jade[0].filename, __jade[0].lineno);
26 | }
27 | }
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/mkdirp/test/return.js:
--------------------------------------------------------------------------------
1 | var mkdirp = require('../');
2 | var path = require('path');
3 | var fs = require('fs');
4 | var test = require('tap').test;
5 |
6 | test('return value', function (t) {
7 | t.plan(4);
8 | var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
9 | var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
10 | var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
11 |
12 | var file = '/tmp/' + [x,y,z].join('/');
13 |
14 | // should return the first dir created.
15 | // By this point, it would be profoundly surprising if /tmp didn't
16 | // already exist, since every other test makes things in there.
17 | mkdirp(file, function (err, made) {
18 | t.ifError(err);
19 | t.equal(made, '/tmp/' + x);
20 | mkdirp(file, function (err, made) {
21 | t.ifError(err);
22 | t.equal(made, null);
23 | });
24 | });
25 | });
26 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/mkdirp/test/return_sync.js:
--------------------------------------------------------------------------------
1 | var mkdirp = require('../');
2 | var path = require('path');
3 | var fs = require('fs');
4 | var test = require('tap').test;
5 |
6 | test('return value', function (t) {
7 | t.plan(2);
8 | var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
9 | var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
10 | var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
11 |
12 | var file = '/tmp/' + [x,y,z].join('/');
13 |
14 | // should return the first dir created.
15 | // By this point, it would be profoundly surprising if /tmp didn't
16 | // already exist, since every other test makes things in there.
17 | // Note that this will throw on failure, which will fail the test.
18 | var made = mkdirp.sync(file);
19 | t.equal(made, '/tmp/' + x);
20 |
21 | // making the same file again should have no effect.
22 | made = mkdirp.sync(file);
23 | t.equal(made, null);
24 | });
25 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/growl/test.js:
--------------------------------------------------------------------------------
1 |
2 | var growl = require('./lib/growl')
3 |
4 | growl('You have mail!')
5 | growl('5 new messages', { sticky: true })
6 | growl('5 new emails', { title: 'Email Client', image: 'Safari', sticky: true })
7 | growl('Message with title', { title: 'Title'})
8 | growl('Set priority', { priority: 2 })
9 | growl('Show Safari icon', { image: 'Safari' })
10 | growl('Show icon', { image: 'path/to/icon.icns' })
11 | growl('Show image', { image: 'path/to/my.image.png' })
12 | growl('Show png filesystem icon', { image: 'png' })
13 | growl('Show pdf filesystem icon', { image: 'article.pdf' })
14 | growl('Show pdf filesystem icon', { image: 'article.pdf' }, function(){
15 | console.log('callback');
16 | })
17 | growl('Show pdf filesystem icon', { title: 'Use show()', image: 'article.pdf' })
18 | growl('here \' are \n some \\ characters that " need escaping', {}, function(error, stdout, stderr) {
19 | if (error !== null) throw new Error('escaping failed:\n' + stdout + stderr);
20 | })
21 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/sync.js:
--------------------------------------------------------------------------------
1 | var mkdirp = require('../');
2 | var path = require('path');
3 | var fs = require('fs');
4 | var test = require('tap').test;
5 |
6 | test('sync', function (t) {
7 | t.plan(2);
8 | var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
9 | var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
10 | var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
11 |
12 | var file = '/tmp/' + [x,y,z].join('/');
13 |
14 | var err = mkdirp.sync(file, 0755);
15 | if (err) t.fail(err);
16 | else path.exists(file, function (ex) {
17 | if (!ex) t.fail('file not created')
18 | else fs.stat(file, function (err, stat) {
19 | if (err) t.fail(err)
20 | else {
21 | t.equal(stat.mode & 0777, 0755);
22 | t.ok(stat.isDirectory(), 'target not a directory');
23 | t.end();
24 | }
25 | })
26 | })
27 | });
28 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/mkdirp/test/clobber.js:
--------------------------------------------------------------------------------
1 | var mkdirp = require('../').mkdirp;
2 | var path = require('path');
3 | var fs = require('fs');
4 | var test = require('tap').test;
5 |
6 | var ps = [ '', 'tmp' ];
7 |
8 | for (var i = 0; i < 25; i++) {
9 | var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
10 | ps.push(dir);
11 | }
12 |
13 | var file = ps.join('/');
14 |
15 | // a file in the way
16 | var itw = ps.slice(0, 3).join('/');
17 |
18 |
19 | test('clobber-pre', function (t) {
20 | console.error("about to write to "+itw)
21 | fs.writeFileSync(itw, 'I AM IN THE WAY, THE TRUTH, AND THE LIGHT.');
22 |
23 | fs.stat(itw, function (er, stat) {
24 | t.ifError(er)
25 | t.ok(stat && stat.isFile(), 'should be file')
26 | t.end()
27 | })
28 | })
29 |
30 | test('clobber', function (t) {
31 | t.plan(2);
32 | mkdirp(file, 0755, function (err) {
33 | t.ok(err);
34 | t.equal(err.code, 'ENOTDIR');
35 | t.end();
36 | });
37 | });
38 |
--------------------------------------------------------------------------------
/spec/roboParseSpec.js:
--------------------------------------------------------------------------------
1 | var PEG = require('pegjs');
2 | var assert = require('chai').assert;
3 | var mocha = require('mocha');
4 | var fs = require('fs'); // for loading files
5 |
6 | var data = fs.readFileSync('../robo.peg', 'utf-8');
7 | // Show the PEG grammar file
8 | // console.log(data);
9 | // Create my parser
10 | var parse = PEG.buildParser(data).parse;
11 |
12 | assert.deepEqual(parse("fire"), ["fire"]);
13 |
14 | suite('Basic commands', function() {
15 | test('move', function(){
16 | assert.deepEqual(
17 | parse("move"), ["move"]
18 | );
19 | });
20 | test('left', function(){
21 | assert.deepEqual(
22 | parse("left"), ["left"]
23 | );
24 | });
25 | test('right', function(){
26 | assert.deepEqual(
27 | parse("right"), ["right"]
28 | );
29 | });
30 | test('fire', function(){
31 | assert.deepEqual(
32 | parse("fire"), ["fire"]
33 | );
34 | });
35 | test('idle', function(){
36 | assert.deepEqual(
37 | parse("idle"), ["idle"]
38 | );
39 | });
40 | });
41 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "jade",
3 | "description": "Jade template engine",
4 | "version": "0.26.3",
5 | "author": {
6 | "name": "TJ Holowaychuk",
7 | "email": "tj@vision-media.ca"
8 | },
9 | "repository": {
10 | "type": "git",
11 | "url": "git://github.com/visionmedia/jade"
12 | },
13 | "main": "./index.js",
14 | "bin": {
15 | "jade": "./bin/jade"
16 | },
17 | "man": [
18 | "./jade.1"
19 | ],
20 | "dependencies": {
21 | "commander": "0.6.1",
22 | "mkdirp": "0.3.0"
23 | },
24 | "devDependencies": {
25 | "mocha": "*",
26 | "markdown": "*",
27 | "stylus": "*",
28 | "uubench": "*",
29 | "should": "*",
30 | "less": "*",
31 | "uglify-js": "*"
32 | },
33 | "component": {
34 | "scripts": {
35 | "jade": "runtime.js"
36 | }
37 | },
38 | "scripts": {
39 | "prepublish": "npm prune"
40 | },
41 | "_id": "jade@0.26.3",
42 | "readme": "ERROR: No README.md file found!",
43 | "_from": "jade@0.26.3"
44 | }
45 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/clobber.js:
--------------------------------------------------------------------------------
1 | var mkdirp = require('../').mkdirp;
2 | var path = require('path');
3 | var fs = require('fs');
4 | var test = require('tap').test;
5 |
6 | var ps = [ '', 'tmp' ];
7 |
8 | for (var i = 0; i < 25; i++) {
9 | var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
10 | ps.push(dir);
11 | }
12 |
13 | var file = ps.join('/');
14 |
15 | // a file in the way
16 | var itw = ps.slice(0, 3).join('/');
17 |
18 |
19 | test('clobber-pre', function (t) {
20 | console.error("about to write to "+itw)
21 | fs.writeFileSync(itw, 'I AM IN THE WAY, THE TRUTH, AND THE LIGHT.');
22 |
23 | fs.stat(itw, function (er, stat) {
24 | t.ifError(er)
25 | t.ok(stat && stat.isFile(), 'should be file')
26 | t.end()
27 | })
28 | })
29 |
30 | test('clobber', function (t) {
31 | t.plan(2);
32 | mkdirp(file, 0755, function (err) {
33 | t.ok(err);
34 | t.equal(err.code, 'ENOTDIR');
35 | t.end();
36 | });
37 | });
38 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/mkdirp/test/perm.js:
--------------------------------------------------------------------------------
1 | var mkdirp = require('../');
2 | var path = require('path');
3 | var fs = require('fs');
4 | var test = require('tap').test;
5 |
6 | test('async perm', function (t) {
7 | t.plan(2);
8 | var file = '/tmp/' + (Math.random() * (1<<30)).toString(16);
9 |
10 | mkdirp(file, 0755, function (err) {
11 | if (err) t.fail(err);
12 | else path.exists(file, function (ex) {
13 | if (!ex) t.fail('file not created')
14 | else fs.stat(file, function (err, stat) {
15 | if (err) t.fail(err)
16 | else {
17 | t.equal(stat.mode & 0777, 0755);
18 | t.ok(stat.isDirectory(), 'target not a directory');
19 | t.end();
20 | }
21 | })
22 | })
23 | });
24 | });
25 |
26 | test('async root perm', function (t) {
27 | mkdirp('/tmp', 0755, function (err) {
28 | if (err) t.fail(err);
29 | t.end();
30 | });
31 | t.end();
32 | });
33 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/umask_sync.js:
--------------------------------------------------------------------------------
1 | var mkdirp = require('../');
2 | var path = require('path');
3 | var fs = require('fs');
4 | var test = require('tap').test;
5 |
6 | test('umask sync modes', function (t) {
7 | t.plan(2);
8 | var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
9 | var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
10 | var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
11 |
12 | var file = '/tmp/' + [x,y,z].join('/');
13 |
14 | var err = mkdirp.sync(file);
15 | if (err) t.fail(err);
16 | else path.exists(file, function (ex) {
17 | if (!ex) t.fail('file not created')
18 | else fs.stat(file, function (err, stat) {
19 | if (err) t.fail(err)
20 | else {
21 | t.equal(stat.mode & 0777, (0777 & (~process.umask())));
22 | t.ok(stat.isDirectory(), 'target not a directory');
23 | t.end();
24 | }
25 | })
26 | })
27 | });
28 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/mkdirp/test/mkdirp.js:
--------------------------------------------------------------------------------
1 | var mkdirp = require('../');
2 | var path = require('path');
3 | var fs = require('fs');
4 | var test = require('tap').test;
5 |
6 | test('woo', function (t) {
7 | t.plan(2);
8 | var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
9 | var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
10 | var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
11 |
12 | var file = '/tmp/' + [x,y,z].join('/');
13 |
14 | mkdirp(file, 0755, function (err) {
15 | if (err) t.fail(err);
16 | else path.exists(file, function (ex) {
17 | if (!ex) t.fail('file not created')
18 | else fs.stat(file, function (err, stat) {
19 | if (err) t.fail(err)
20 | else {
21 | t.equal(stat.mode & 0777, 0755);
22 | t.ok(stat.isDirectory(), 'target not a directory');
23 | t.end();
24 | }
25 | })
26 | })
27 | });
28 | });
29 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/mkdirp/test/sync.js:
--------------------------------------------------------------------------------
1 | var mkdirp = require('../');
2 | var path = require('path');
3 | var fs = require('fs');
4 | var test = require('tap').test;
5 |
6 | test('sync', function (t) {
7 | t.plan(2);
8 | var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
9 | var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
10 | var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
11 |
12 | var file = '/tmp/' + [x,y,z].join('/');
13 |
14 | try {
15 | mkdirp.sync(file, 0755);
16 | } catch (err) {
17 | t.fail(err);
18 | return t.end();
19 | }
20 |
21 | path.exists(file, function (ex) {
22 | if (!ex) t.fail('file not created')
23 | else fs.stat(file, function (err, stat) {
24 | if (err) t.fail(err)
25 | else {
26 | t.equal(stat.mode & 0777, 0755);
27 | t.ok(stat.isDirectory(), 'target not a directory');
28 | t.end();
29 | }
30 | });
31 | });
32 | });
33 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/ms/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "ms",
3 | "version": "0.3.0",
4 | "description": "Tiny ms conversion utility",
5 | "main": "./ms",
6 | "devDependencies": {
7 | "mocha": "*",
8 | "expect.js": "*",
9 | "serve": "*"
10 | },
11 | "readme": "# ms.js: miliseconds conversion utility\n\n```js\nms('1d') // 86400000\nms('10h') // 36000000\nms('2h') // 7200000\nms('1m') // 60000\nms('5s') // 5000\nms('100') // 100\nms(100) // 100\n```\n\n```js\nms(60000) // \"1 minute\"\nms(2 * 60000) // \"2 minutes\"\nms(ms('10 hours')) // \"10 hours\"\n```\n\n- Node/Browser compatible. Published as `ms` in NPM.\n- If a number is supplied to `ms`, it returns it immediately.\n- If a string that contains the number is supplied, it returns it as\na number (e.g: it returns `100` for `'100'`).\n- If you pass a string with a number and a valid unit, the number of\nequivalent ms is returned.\n",
12 | "readmeFilename": "README.md",
13 | "_id": "ms@0.3.0",
14 | "_from": "ms@0.3.0"
15 | }
16 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/perm.js:
--------------------------------------------------------------------------------
1 | var mkdirp = require('../');
2 | var path = require('path');
3 | var fs = require('fs');
4 | var test = require('tap').test;
5 |
6 | test('async perm', function (t) {
7 | t.plan(2);
8 | var file = '/tmp/' + (Math.random() * (1<<30)).toString(16);
9 |
10 | mkdirp(file, 0755, function (err) {
11 | if (err) t.fail(err);
12 | else path.exists(file, function (ex) {
13 | if (!ex) t.fail('file not created')
14 | else fs.stat(file, function (err, stat) {
15 | if (err) t.fail(err)
16 | else {
17 | t.equal(stat.mode & 0777, 0755);
18 | t.ok(stat.isDirectory(), 'target not a directory');
19 | t.end();
20 | }
21 | })
22 | })
23 | });
24 | });
25 |
26 | test('async root perm', function (t) {
27 | mkdirp('/tmp', 0755, function (err) {
28 | if (err) t.fail(err);
29 | t.end();
30 | });
31 | t.end();
32 | });
33 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/mkdirp.js:
--------------------------------------------------------------------------------
1 | var mkdirp = require('../');
2 | var path = require('path');
3 | var fs = require('fs');
4 | var test = require('tap').test;
5 |
6 | test('woo', function (t) {
7 | t.plan(2);
8 | var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
9 | var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
10 | var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
11 |
12 | var file = '/tmp/' + [x,y,z].join('/');
13 |
14 | mkdirp(file, 0755, function (err) {
15 | if (err) t.fail(err);
16 | else path.exists(file, function (ex) {
17 | if (!ex) t.fail('file not created')
18 | else fs.stat(file, function (err, stat) {
19 | if (err) t.fail(err)
20 | else {
21 | t.equal(stat.mode & 0777, 0755);
22 | t.ok(stat.isDirectory(), 'target not a directory');
23 | t.end();
24 | }
25 | })
26 | })
27 | });
28 | });
29 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/mkdirp/test/umask.js:
--------------------------------------------------------------------------------
1 | var mkdirp = require('../');
2 | var path = require('path');
3 | var fs = require('fs');
4 | var test = require('tap').test;
5 |
6 | test('implicit mode from umask', function (t) {
7 | t.plan(2);
8 | var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
9 | var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
10 | var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
11 |
12 | var file = '/tmp/' + [x,y,z].join('/');
13 |
14 | mkdirp(file, function (err) {
15 | if (err) t.fail(err);
16 | else path.exists(file, function (ex) {
17 | if (!ex) t.fail('file not created')
18 | else fs.stat(file, function (err, stat) {
19 | if (err) t.fail(err)
20 | else {
21 | t.equal(stat.mode & 0777, 0777 & (~process.umask()));
22 | t.ok(stat.isDirectory(), 'target not a directory');
23 | t.end();
24 | }
25 | })
26 | })
27 | });
28 | });
29 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/mkdirp/test/umask_sync.js:
--------------------------------------------------------------------------------
1 | var mkdirp = require('../');
2 | var path = require('path');
3 | var fs = require('fs');
4 | var test = require('tap').test;
5 |
6 | test('umask sync modes', function (t) {
7 | t.plan(2);
8 | var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
9 | var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
10 | var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
11 |
12 | var file = '/tmp/' + [x,y,z].join('/');
13 |
14 | try {
15 | mkdirp.sync(file);
16 | } catch (err) {
17 | t.fail(err);
18 | return t.end();
19 | }
20 |
21 | path.exists(file, function (ex) {
22 | if (!ex) t.fail('file not created')
23 | else fs.stat(file, function (err, stat) {
24 | if (err) t.fail(err)
25 | else {
26 | t.equal(stat.mode & 0777, (0777 & (~process.umask())));
27 | t.ok(stat.isDirectory(), 'target not a directory');
28 | t.end();
29 | }
30 | });
31 | });
32 | });
33 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/umask.js:
--------------------------------------------------------------------------------
1 | var mkdirp = require('../');
2 | var path = require('path');
3 | var fs = require('fs');
4 | var test = require('tap').test;
5 |
6 | test('implicit mode from umask', function (t) {
7 | t.plan(2);
8 | var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
9 | var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
10 | var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
11 |
12 | var file = '/tmp/' + [x,y,z].join('/');
13 |
14 | mkdirp(file, function (err) {
15 | if (err) t.fail(err);
16 | else path.exists(file, function (ex) {
17 | if (!ex) t.fail('file not created')
18 | else fs.stat(file, function (err, stat) {
19 | if (err) t.fail(err)
20 | else {
21 | t.equal(stat.mode & 0777, 0777 & (~process.umask()));
22 | t.ok(stat.isDirectory(), 'target not a directory');
23 | t.end();
24 | }
25 | })
26 | })
27 | });
28 | });
29 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/lib/doctypes.js:
--------------------------------------------------------------------------------
1 |
2 | /*!
3 | * Jade - doctypes
4 | * Copyright(c) 2010 TJ Holowaychuk
5 | * MIT Licensed
6 | */
7 |
8 | module.exports = {
9 | '5': ''
10 | , 'default': ''
11 | , 'xml': ''
12 | , 'transitional': ''
13 | , 'strict': ''
14 | , 'frameset': ''
15 | , '1.1': ''
16 | , 'basic': ''
17 | , 'mobile': ''
18 | };
--------------------------------------------------------------------------------
/spec/node_modules/mocha/lib/reporters/html-cov.js:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * Module dependencies.
4 | */
5 |
6 | var JSONCov = require('./json-cov')
7 | , fs = require('fs');
8 |
9 | /**
10 | * Expose `HTMLCov`.
11 | */
12 |
13 | exports = module.exports = HTMLCov;
14 |
15 | /**
16 | * Initialize a new `JsCoverage` reporter.
17 | *
18 | * @param {Runner} runner
19 | * @api public
20 | */
21 |
22 | function HTMLCov(runner) {
23 | var jade = require('jade')
24 | , file = __dirname + '/templates/coverage.jade'
25 | , str = fs.readFileSync(file, 'utf8')
26 | , fn = jade.compile(str, { filename: file })
27 | , self = this;
28 |
29 | JSONCov.call(this, runner, false);
30 |
31 | runner.on('end', function(){
32 | process.stdout.write(fn({
33 | cov: self.cov
34 | , coverageClass: coverageClass
35 | }));
36 | });
37 | }
38 |
39 | /**
40 | * Return coverage class for `n`.
41 | *
42 | * @return {String}
43 | * @api private
44 | */
45 |
46 | function coverageClass(n) {
47 | if (n >= 75) return 'high';
48 | if (n >= 50) return 'medium';
49 | if (n >= 25) return 'low';
50 | return 'terrible';
51 | }
--------------------------------------------------------------------------------
/lib/jasmine-1.3.1/MIT.LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2008-2011 Pivotal Labs
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining
4 | a copy of this software and associated documentation files (the
5 | "Software"), to deal in the Software without restriction, including
6 | without limitation the rights to use, copy, modify, merge, publish,
7 | distribute, sublicense, and/or sell copies of the Software, and to
8 | permit persons to whom the Software is furnished to do so, subject to
9 | the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be
12 | included in all copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/spec/node_modules/pegjs/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2010-2012 David Majda
2 |
3 | Permission is hereby granted, free of charge, to any person
4 | obtaining a copy of this software and associated documentation
5 | files (the "Software"), to deal in the Software without
6 | restriction, including without limitation the rights to use,
7 | copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | copies of the Software, and to permit persons to whom the
9 | Software is furnished to do so, subject to the following
10 | conditions:
11 |
12 | The above copyright notice and this permission notice shall be
13 | included in all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | OTHER DEALINGS IN THE SOFTWARE.
23 |
--------------------------------------------------------------------------------
/spec/node_modules/chai/lib/chai/utils/addMethod.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * Chai - addMethod utility
3 | * Copyright(c) 2012-2013 Jake Luer
4 | * MIT Licensed
5 | */
6 |
7 | /**
8 | * ### .addMethod (ctx, name, method)
9 | *
10 | * Adds a method to the prototype of an object.
11 | *
12 | * utils.addMethod(chai.Assertion.prototype, 'foo', function (str) {
13 | * var obj = utils.flag(this, 'object');
14 | * new chai.Assertion(obj).to.be.equal(str);
15 | * });
16 | *
17 | * Can also be accessed directly from `chai.Assertion`.
18 | *
19 | * chai.Assertion.addMethod('foo', fn);
20 | *
21 | * Then can be used as any other assertion.
22 | *
23 | * expect(fooStr).to.be.foo('bar');
24 | *
25 | * @param {Object} ctx object to which the method is added
26 | * @param {String} name of method to add
27 | * @param {Function} method function to be used for name
28 | * @name addMethod
29 | * @api public
30 | */
31 |
32 | module.exports = function (ctx, name, method) {
33 | ctx[name] = function () {
34 | var result = method.apply(this, arguments);
35 | return result === undefined ? this : result;
36 | };
37 | };
38 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/mkdirp/test/rel.js:
--------------------------------------------------------------------------------
1 | var mkdirp = require('../');
2 | var path = require('path');
3 | var fs = require('fs');
4 | var test = require('tap').test;
5 |
6 | test('rel', function (t) {
7 | t.plan(2);
8 | var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
9 | var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
10 | var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
11 |
12 | var cwd = process.cwd();
13 | process.chdir('/tmp');
14 |
15 | var file = [x,y,z].join('/');
16 |
17 | mkdirp(file, 0755, function (err) {
18 | if (err) t.fail(err);
19 | else path.exists(file, function (ex) {
20 | if (!ex) t.fail('file not created')
21 | else fs.stat(file, function (err, stat) {
22 | if (err) t.fail(err)
23 | else {
24 | process.chdir(cwd);
25 | t.equal(stat.mode & 0777, 0755);
26 | t.ok(stat.isDirectory(), 'target not a directory');
27 | t.end();
28 | }
29 | })
30 | })
31 | });
32 | });
33 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/lib/utils.js:
--------------------------------------------------------------------------------
1 |
2 | /*!
3 | * Jade - utils
4 | * Copyright(c) 2010 TJ Holowaychuk
5 | * MIT Licensed
6 | */
7 |
8 | /**
9 | * Convert interpolation in the given string to JavaScript.
10 | *
11 | * @param {String} str
12 | * @return {String}
13 | * @api private
14 | */
15 |
16 | var interpolate = exports.interpolate = function(str){
17 | return str.replace(/(\\)?([#!]){(.*?)}/g, function(str, escape, flag, code){
18 | return escape
19 | ? str
20 | : "' + "
21 | + ('!' == flag ? '' : 'escape')
22 | + "((interp = " + code.replace(/\\'/g, "'")
23 | + ") == null ? '' : interp) + '";
24 | });
25 | };
26 |
27 | /**
28 | * Escape single quotes in `str`.
29 | *
30 | * @param {String} str
31 | * @return {String}
32 | * @api private
33 | */
34 |
35 | var escape = exports.escape = function(str) {
36 | return str.replace(/'/g, "\\'");
37 | };
38 |
39 | /**
40 | * Interpolate, and escape the given `str`.
41 | *
42 | * @param {String} str
43 | * @return {String}
44 | * @api private
45 | */
46 |
47 | exports.text = function(str){
48 | return interpolate(escape(str));
49 | };
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/rel.js:
--------------------------------------------------------------------------------
1 | var mkdirp = require('../');
2 | var path = require('path');
3 | var fs = require('fs');
4 | var test = require('tap').test;
5 |
6 | test('rel', function (t) {
7 | t.plan(2);
8 | var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
9 | var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
10 | var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
11 |
12 | var cwd = process.cwd();
13 | process.chdir('/tmp');
14 |
15 | var file = [x,y,z].join('/');
16 |
17 | mkdirp(file, 0755, function (err) {
18 | if (err) t.fail(err);
19 | else path.exists(file, function (ex) {
20 | if (!ex) t.fail('file not created')
21 | else fs.stat(file, function (err, stat) {
22 | if (err) t.fail(err)
23 | else {
24 | process.chdir(cwd);
25 | t.equal(stat.mode & 0777, 0755);
26 | t.ok(stat.isDirectory(), 'target not a directory');
27 | t.end();
28 | }
29 | })
30 | })
31 | });
32 | });
33 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/LICENSE:
--------------------------------------------------------------------------------
1 | (The MIT License)
2 |
3 | Copyright (c) 2011-2013 TJ Holowaychuk
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining
6 | a copy of this software and associated documentation files (the
7 | 'Software'), to deal in the Software without restriction, including
8 | without limitation the rights to use, copy, modify, merge, publish,
9 | distribute, sublicense, and/or sell copies of the Software, and to
10 | permit persons to whom the Software is furnished to do so, subject to
11 | the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be
14 | included in all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/LICENSE:
--------------------------------------------------------------------------------
1 | (The MIT License)
2 |
3 | Copyright (c) 2009-2010 TJ Holowaychuk
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining
6 | a copy of this software and associated documentation files (the
7 | 'Software'), to deal in the Software without restriction, including
8 | without limitation the rights to use, copy, modify, merge, publish,
9 | distribute, sublicense, and/or sell copies of the Software, and to
10 | permit persons to whom the Software is furnished to do so, subject to
11 | the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be
14 | included in all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/node_modules/mkdirp/README.markdown:
--------------------------------------------------------------------------------
1 | mkdirp
2 | ======
3 |
4 | Like `mkdir -p`, but in node.js!
5 |
6 | example
7 | =======
8 |
9 | pow.js
10 | ------
11 | var mkdirp = require('mkdirp');
12 |
13 | mkdirp('/tmp/foo/bar/baz', function (err) {
14 | if (err) console.error(err)
15 | else console.log('pow!')
16 | });
17 |
18 | Output
19 | pow!
20 |
21 | And now /tmp/foo/bar/baz exists, huzzah!
22 |
23 | methods
24 | =======
25 |
26 | var mkdirp = require('mkdirp');
27 |
28 | mkdirp(dir, mode, cb)
29 | ---------------------
30 |
31 | Create a new directory and any necessary subdirectories at `dir` with octal
32 | permission string `mode`.
33 |
34 | If `mode` isn't specified, it defaults to `0777 & (~process.umask())`.
35 |
36 | mkdirp.sync(dir, mode)
37 | ----------------------
38 |
39 | Synchronously create a new directory and any necessary subdirectories at `dir`
40 | with octal permission string `mode`.
41 |
42 | If `mode` isn't specified, it defaults to `0777 & (~process.umask())`.
43 |
44 | install
45 | =======
46 |
47 | With [npm](http://npmjs.org) do:
48 |
49 | npm install mkdirp
50 |
51 | license
52 | =======
53 |
54 | MIT/X11
55 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/mkdirp/test/chmod.js:
--------------------------------------------------------------------------------
1 | var mkdirp = require('../').mkdirp;
2 | var path = require('path');
3 | var fs = require('fs');
4 | var test = require('tap').test;
5 |
6 | var ps = [ '', 'tmp' ];
7 |
8 | for (var i = 0; i < 25; i++) {
9 | var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
10 | ps.push(dir);
11 | }
12 |
13 | var file = ps.join('/');
14 |
15 | test('chmod-pre', function (t) {
16 | var mode = 0744
17 | mkdirp(file, mode, function (er) {
18 | t.ifError(er, 'should not error');
19 | fs.stat(file, function (er, stat) {
20 | t.ifError(er, 'should exist');
21 | t.ok(stat && stat.isDirectory(), 'should be directory');
22 | t.equal(stat && stat.mode & 0777, mode, 'should be 0744');
23 | t.end();
24 | });
25 | });
26 | });
27 |
28 | test('chmod', function (t) {
29 | var mode = 0755
30 | mkdirp(file, mode, function (er) {
31 | t.ifError(er, 'should not error');
32 | fs.stat(file, function (er, stat) {
33 | t.ifError(er, 'should exist');
34 | t.ok(stat && stat.isDirectory(), 'should be directory');
35 | t.end();
36 | });
37 | });
38 | });
39 |
--------------------------------------------------------------------------------
/spec/node_modules/chai/lib/chai/utils/addProperty.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * Chai - addProperty utility
3 | * Copyright(c) 2012-2013 Jake Luer
4 | * MIT Licensed
5 | */
6 |
7 | /**
8 | * ### addProperty (ctx, name, getter)
9 | *
10 | * Adds a property to the prototype of an object.
11 | *
12 | * utils.addProperty(chai.Assertion.prototype, 'foo', function () {
13 | * var obj = utils.flag(this, 'object');
14 | * new chai.Assertion(obj).to.be.instanceof(Foo);
15 | * });
16 | *
17 | * Can also be accessed directly from `chai.Assertion`.
18 | *
19 | * chai.Assertion.addProperty('foo', fn);
20 | *
21 | * Then can be used as any other assertion.
22 | *
23 | * expect(myFoo).to.be.foo;
24 | *
25 | * @param {Object} ctx object to which the property is added
26 | * @param {String} name of property to add
27 | * @param {Function} getter function to be used for name
28 | * @name addProperty
29 | * @api public
30 | */
31 |
32 | module.exports = function (ctx, name, getter) {
33 | Object.defineProperty(ctx, name,
34 | { get: function () {
35 | var result = getter.call(this);
36 | return result === undefined ? this : result;
37 | }
38 | , configurable: true
39 | });
40 | };
41 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/mkdirp/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright 2010 James Halliday (mail@substack.net)
2 |
3 | This project is free software released under the MIT/X11 license:
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/chmod.js:
--------------------------------------------------------------------------------
1 | var mkdirp = require('../').mkdirp;
2 | var path = require('path');
3 | var fs = require('fs');
4 | var test = require('tap').test;
5 |
6 | var ps = [ '', 'tmp' ];
7 |
8 | for (var i = 0; i < 25; i++) {
9 | var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
10 | ps.push(dir);
11 | }
12 |
13 | var file = ps.join('/');
14 |
15 | test('chmod-pre', function (t) {
16 | var mode = 0744
17 | mkdirp(file, mode, function (er) {
18 | t.ifError(er, 'should not error');
19 | fs.stat(file, function (er, stat) {
20 | t.ifError(er, 'should exist');
21 | t.ok(stat && stat.isDirectory(), 'should be directory');
22 | t.equal(stat && stat.mode & 0777, mode, 'should be 0744');
23 | t.end();
24 | });
25 | });
26 | });
27 |
28 | test('chmod', function (t) {
29 | var mode = 0755
30 | mkdirp(file, mode, function (er) {
31 | t.ifError(er, 'should not error');
32 | fs.stat(file, function (er, stat) {
33 | t.ifError(er, 'should exist');
34 | t.ok(stat && stat.isDirectory(), 'should be directory');
35 | t.end();
36 | });
37 | });
38 | });
39 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/node_modules/mkdirp/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright 2010 James Halliday (mail@substack.net)
2 |
3 | This project is free software released under the MIT/X11 license:
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/mkdirp/test/perm_sync.js:
--------------------------------------------------------------------------------
1 | var mkdirp = require('../');
2 | var path = require('path');
3 | var fs = require('fs');
4 | var test = require('tap').test;
5 |
6 | test('sync perm', function (t) {
7 | t.plan(2);
8 | var file = '/tmp/' + (Math.random() * (1<<30)).toString(16) + '.json';
9 |
10 | mkdirp.sync(file, 0755);
11 | path.exists(file, function (ex) {
12 | if (!ex) t.fail('file not created')
13 | else fs.stat(file, function (err, stat) {
14 | if (err) t.fail(err)
15 | else {
16 | t.equal(stat.mode & 0777, 0755);
17 | t.ok(stat.isDirectory(), 'target not a directory');
18 | t.end();
19 | }
20 | })
21 | });
22 | });
23 |
24 | test('sync root perm', function (t) {
25 | t.plan(1);
26 |
27 | var file = '/tmp';
28 | mkdirp.sync(file, 0755);
29 | path.exists(file, function (ex) {
30 | if (!ex) t.fail('file not created')
31 | else fs.stat(file, function (err, stat) {
32 | if (err) t.fail(err)
33 | else {
34 | t.ok(stat.isDirectory(), 'target not a directory');
35 | t.end();
36 | }
37 | })
38 | });
39 | });
40 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/perm_sync.js:
--------------------------------------------------------------------------------
1 | var mkdirp = require('../');
2 | var path = require('path');
3 | var fs = require('fs');
4 | var test = require('tap').test;
5 |
6 | test('sync perm', function (t) {
7 | t.plan(2);
8 | var file = '/tmp/' + (Math.random() * (1<<30)).toString(16) + '.json';
9 |
10 | mkdirp.sync(file, 0755);
11 | path.exists(file, function (ex) {
12 | if (!ex) t.fail('file not created')
13 | else fs.stat(file, function (err, stat) {
14 | if (err) t.fail(err)
15 | else {
16 | t.equal(stat.mode & 0777, 0755);
17 | t.ok(stat.isDirectory(), 'target not a directory');
18 | t.end();
19 | }
20 | })
21 | });
22 | });
23 |
24 | test('sync root perm', function (t) {
25 | t.plan(1);
26 |
27 | var file = '/tmp';
28 | mkdirp.sync(file, 0755);
29 | path.exists(file, function (ex) {
30 | if (!ex) t.fail('file not created')
31 | else fs.stat(file, function (err, stat) {
32 | if (err) t.fail(err)
33 | else {
34 | t.ok(stat.isDirectory(), 'target not a directory');
35 | t.end();
36 | }
37 | })
38 | });
39 | });
40 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/bin/mocha:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | /**
4 | * This tiny wrapper file checks for known node flags and appends them
5 | * when found, before invoking the "real" _mocha(1) executable.
6 | */
7 |
8 | var spawn = require('child_process').spawn
9 | , args = [ __dirname + '/_mocha' ];
10 |
11 | process.argv.slice(2).forEach(function (arg) {
12 | switch (arg) {
13 | case '-d':
14 | args.unshift('--debug');
15 | break;
16 | case 'debug':
17 | case '--debug':
18 | case '--debug-brk':
19 | args.unshift(arg);
20 | break;
21 | case '-gc':
22 | case '--expose-gc':
23 | args.unshift('--expose-gc');
24 | break;
25 | case '--gc-global':
26 | case '--harmony':
27 | case '--harmony-proxies':
28 | case '--harmony-collections':
29 | args.unshift(arg);
30 | break;
31 | default:
32 | if (0 == arg.indexOf('--trace')) args.unshift(arg);
33 | else args.push(arg);
34 | break;
35 | }
36 | });
37 |
38 | var proc = spawn(process.argv[0], args, { customFds: [0,1,2] });
39 | proc.on('exit', function (code, signal) {
40 | process.on('exit', function(){
41 | if (signal) {
42 | process.kill(process.pid, signal);
43 | } else {
44 | process.exit(code);
45 | }
46 | });
47 | });
48 |
--------------------------------------------------------------------------------
/spec/node_modules/chai/lib/chai/utils/type.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * Chai - type utility
3 | * Copyright(c) 2012-2013 Jake Luer
4 | * MIT Licensed
5 | */
6 |
7 | /*!
8 | * Detectable javascript natives
9 | */
10 |
11 | var natives = {
12 | '[object Arguments]': 'arguments'
13 | , '[object Array]': 'array'
14 | , '[object Date]': 'date'
15 | , '[object Function]': 'function'
16 | , '[object Number]': 'number'
17 | , '[object RegExp]': 'regexp'
18 | , '[object String]': 'string'
19 | };
20 |
21 | /**
22 | * ### type(object)
23 | *
24 | * Better implementation of `typeof` detection that can
25 | * be used cross-browser. Handles the inconsistencies of
26 | * Array, `null`, and `undefined` detection.
27 | *
28 | * utils.type({}) // 'object'
29 | * utils.type(null) // `null'
30 | * utils.type(undefined) // `undefined`
31 | * utils.type([]) // `array`
32 | *
33 | * @param {Mixed} object to detect type of
34 | * @name type
35 | * @api private
36 | */
37 |
38 | module.exports = function (obj) {
39 | var str = Object.prototype.toString.call(obj);
40 | if (natives[str]) return natives[str];
41 | if (obj === null) return 'null';
42 | if (obj === undefined) return 'undefined';
43 | if (obj === Object(obj)) return 'object';
44 | return typeof obj;
45 | };
46 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/mkdirp/test/race.js:
--------------------------------------------------------------------------------
1 | var mkdirp = require('../').mkdirp;
2 | var path = require('path');
3 | var fs = require('fs');
4 | var test = require('tap').test;
5 |
6 | test('race', function (t) {
7 | t.plan(4);
8 | var ps = [ '', 'tmp' ];
9 |
10 | for (var i = 0; i < 25; i++) {
11 | var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
12 | ps.push(dir);
13 | }
14 | var file = ps.join('/');
15 |
16 | var res = 2;
17 | mk(file, function () {
18 | if (--res === 0) t.end();
19 | });
20 |
21 | mk(file, function () {
22 | if (--res === 0) t.end();
23 | });
24 |
25 | function mk (file, cb) {
26 | mkdirp(file, 0755, function (err) {
27 | if (err) t.fail(err);
28 | else path.exists(file, function (ex) {
29 | if (!ex) t.fail('file not created')
30 | else fs.stat(file, function (err, stat) {
31 | if (err) t.fail(err)
32 | else {
33 | t.equal(stat.mode & 0777, 0755);
34 | t.ok(stat.isDirectory(), 'target not a directory');
35 | if (cb) cb();
36 | }
37 | })
38 | })
39 | });
40 | }
41 | });
42 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/race.js:
--------------------------------------------------------------------------------
1 | var mkdirp = require('../').mkdirp;
2 | var path = require('path');
3 | var fs = require('fs');
4 | var test = require('tap').test;
5 |
6 | test('race', function (t) {
7 | t.plan(4);
8 | var ps = [ '', 'tmp' ];
9 |
10 | for (var i = 0; i < 25; i++) {
11 | var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
12 | ps.push(dir);
13 | }
14 | var file = ps.join('/');
15 |
16 | var res = 2;
17 | mk(file, function () {
18 | if (--res === 0) t.end();
19 | });
20 |
21 | mk(file, function () {
22 | if (--res === 0) t.end();
23 | });
24 |
25 | function mk (file, cb) {
26 | mkdirp(file, 0755, function (err) {
27 | if (err) t.fail(err);
28 | else path.exists(file, function (ex) {
29 | if (!ex) t.fail('file not created')
30 | else fs.stat(file, function (err, stat) {
31 | if (err) t.fail(err)
32 | else {
33 | t.equal(stat.mode & 0777, 0755);
34 | t.ok(stat.isDirectory(), 'target not a directory');
35 | if (cb) cb();
36 | }
37 | })
38 | })
39 | });
40 | }
41 | });
42 |
--------------------------------------------------------------------------------
/spec/node_modules/chai/lib/chai/utils/objDisplay.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * Chai - flag utility
3 | * Copyright(c) 2012-2013 Jake Luer
4 | * MIT Licensed
5 | */
6 |
7 | /*!
8 | * Module dependancies
9 | */
10 |
11 | var inspect = require('./inspect');
12 |
13 | /**
14 | * ### .objDisplay (object)
15 | *
16 | * Determines if an object or an array matches
17 | * criteria to be inspected in-line for error
18 | * messages or should be truncated.
19 | *
20 | * @param {Mixed} javascript object to inspect
21 | * @name objDisplay
22 | * @api public
23 | */
24 |
25 | module.exports = function (obj) {
26 | var str = inspect(obj)
27 | , type = Object.prototype.toString.call(obj);
28 |
29 | if (str.length >= 40) {
30 | if (type === '[object Function]') {
31 | return !obj.name || obj.name === ''
32 | ? '[Function]'
33 | : '[Function: ' + obj.name + ']';
34 | } else if (type === '[object Array]') {
35 | return '[ Array(' + obj.length + ') ]';
36 | } else if (type === '[object Object]') {
37 | var keys = Object.keys(obj)
38 | , kstr = keys.length > 2
39 | ? keys.splice(0, 2).join(', ') + ', ...'
40 | : keys.join(', ');
41 | return '{ Object (' + kstr + ') }';
42 | } else {
43 | return str;
44 | }
45 | } else {
46 | return str;
47 | }
48 | };
49 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/lib/reporters/json-stream.js:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * Module dependencies.
4 | */
5 |
6 | var Base = require('./base')
7 | , color = Base.color;
8 |
9 | /**
10 | * Expose `List`.
11 | */
12 |
13 | exports = module.exports = List;
14 |
15 | /**
16 | * Initialize a new `List` test reporter.
17 | *
18 | * @param {Runner} runner
19 | * @api public
20 | */
21 |
22 | function List(runner) {
23 | Base.call(this, runner);
24 |
25 | var self = this
26 | , stats = this.stats
27 | , total = runner.total;
28 |
29 | runner.on('start', function(){
30 | console.log(JSON.stringify(['start', { total: total }]));
31 | });
32 |
33 | runner.on('pass', function(test){
34 | console.log(JSON.stringify(['pass', clean(test)]));
35 | });
36 |
37 | runner.on('fail', function(test, err){
38 | console.log(JSON.stringify(['fail', clean(test)]));
39 | });
40 |
41 | runner.on('end', function(){
42 | process.stdout.write(JSON.stringify(['end', self.stats]));
43 | });
44 | }
45 |
46 | /**
47 | * Return a plain-object representation of `test`
48 | * free of cyclic properties etc.
49 | *
50 | * @param {Object} test
51 | * @return {Object}
52 | * @api private
53 | */
54 |
55 | function clean(test) {
56 | return {
57 | title: test.title
58 | , fullTitle: test.fullTitle()
59 | , duration: test.duration
60 | }
61 | }
--------------------------------------------------------------------------------
/spec/node_modules/mocha/Readme.md:
--------------------------------------------------------------------------------
1 | [](http://travis-ci.org/visionmedia/mocha)
2 |
3 | [](http://visionmedia.github.com/mocha)
4 |
5 | Mocha is a simple, flexible, fun JavaScript test framework for node.js and the browser. For more information view the [documentation](http://visionmedia.github.com/mocha).
6 |
7 | ## Contributors
8 |
9 | ```
10 |
11 | project : mocha
12 | repo age : 1 year, 3 months
13 | active : 233 days
14 | commits : 1034
15 | files : 114
16 | authors :
17 | 451 TJ Holowaychuk 43.6%
18 | 389 Tj Holowaychuk 37.6%
19 | 31 Guillermo Rauch 3.0%
20 | 13 Attila Domokos 1.3%
21 | 8 Jo Liss 0.8%
22 | 7 Nathan Rajlich 0.7%
23 | 6 James Carr 0.6%
24 | 6 Brendan Nee 0.6%
25 | 5 John Firebaugh 0.5%
26 | 5 Aaron Heckmann 0.5%
27 | 4 Joshua Krall 0.4%
28 | 4 Xavier Antoviaque 0.4%
29 | 4 hokaccha 0.4%
30 | ```
31 |
32 | ## Links
33 |
34 | - [Google Group](http://groups.google.com/group/mochajs)
35 | - [Wiki](https://github.com/visionmedia/mocha/wiki)
36 | - Mocha [Extensions and reporters](https://github.com/visionmedia/mocha/wiki)
--------------------------------------------------------------------------------
/spec/node_modules/mocha/lib/context.js:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * Expose `Context`.
4 | */
5 |
6 | module.exports = Context;
7 |
8 | /**
9 | * Initialize a new `Context`.
10 | *
11 | * @api private
12 | */
13 |
14 | function Context(){}
15 |
16 | /**
17 | * Set or get the context `Runnable` to `runnable`.
18 | *
19 | * @param {Runnable} runnable
20 | * @return {Context}
21 | * @api private
22 | */
23 |
24 | Context.prototype.runnable = function(runnable){
25 | if (0 == arguments.length) return this._runnable;
26 | this.test = this._runnable = runnable;
27 | return this;
28 | };
29 |
30 | /**
31 | * Set test timeout `ms`.
32 | *
33 | * @param {Number} ms
34 | * @return {Context} self
35 | * @api private
36 | */
37 |
38 | Context.prototype.timeout = function(ms){
39 | this.runnable().timeout(ms);
40 | return this;
41 | };
42 |
43 | /**
44 | * Set test slowness threshold `ms`.
45 | *
46 | * @param {Number} ms
47 | * @return {Context} self
48 | * @api private
49 | */
50 |
51 | Context.prototype.slow = function(ms){
52 | this.runnable().slow(ms);
53 | return this;
54 | };
55 |
56 | /**
57 | * Inspect the context void of `._runnable`.
58 | *
59 | * @return {String}
60 | * @api private
61 | */
62 |
63 | Context.prototype.inspect = function(){
64 | return JSON.stringify(this, function(key, val){
65 | if ('_runnable' == key) return;
66 | if ('test' == key) return;
67 | return val;
68 | }, 2);
69 | };
70 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/lib/reporters/doc.js:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * Module dependencies.
4 | */
5 |
6 | var Base = require('./base')
7 | , utils = require('../utils');
8 |
9 | /**
10 | * Expose `Doc`.
11 | */
12 |
13 | exports = module.exports = Doc;
14 |
15 | /**
16 | * Initialize a new `Doc` reporter.
17 | *
18 | * @param {Runner} runner
19 | * @api public
20 | */
21 |
22 | function Doc(runner) {
23 | Base.call(this, runner);
24 |
25 | var self = this
26 | , stats = this.stats
27 | , total = runner.total
28 | , indents = 2;
29 |
30 | function indent() {
31 | return Array(indents).join(' ');
32 | }
33 |
34 | runner.on('suite', function(suite){
35 | if (suite.root) return;
36 | ++indents;
37 | console.log('%s', indent());
38 | ++indents;
39 | console.log('%s%s
', indent(), utils.escape(suite.title));
40 | console.log('%s', indent());
41 | });
42 |
43 | runner.on('suite end', function(suite){
44 | if (suite.root) return;
45 | console.log('%s
', indent());
46 | --indents;
47 | console.log('%s', indent());
48 | --indents;
49 | });
50 |
51 | runner.on('pass', function(test){
52 | console.log('%s %s', indent(), utils.escape(test.title));
53 | var code = utils.escape(utils.clean(test.fn.toString()));
54 | console.log('%s %s
', indent(), code);
55 | });
56 | }
57 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/growl/History.md:
--------------------------------------------------------------------------------
1 |
2 | 1.7.0 / 2012-12-30
3 | ==================
4 |
5 | * support transient notifications in Gnome
6 |
7 | 1.6.1 / 2012-09-25
8 | ==================
9 |
10 | * restore compatibility with node < 0.8 [fgnass]
11 |
12 | 1.6.0 / 2012-09-06
13 | ==================
14 |
15 | * add notification center support [drudge]
16 |
17 | 1.5.1 / 2012-04-08
18 | ==================
19 |
20 | * Merge pull request #16 from KyleAMathews/patch-1
21 | * Fixes #15
22 |
23 | 1.5.0 / 2012-02-08
24 | ==================
25 |
26 | * Added windows support [perfusorius]
27 |
28 | 1.4.1 / 2011-12-28
29 | ==================
30 |
31 | * Fixed: dont exit(). Closes #9
32 |
33 | 1.4.0 / 2011-12-17
34 | ==================
35 |
36 | * Changed API: `growl.notify()` -> `growl()`
37 |
38 | 1.3.0 / 2011-12-17
39 | ==================
40 |
41 | * Added support for Ubuntu/Debian/Linux users [niftylettuce]
42 | * Fixed: send notifications even if title not specified [alessioalex]
43 |
44 | 1.2.0 / 2011-10-06
45 | ==================
46 |
47 | * Add support for priority.
48 |
49 | 1.1.0 / 2011-03-15
50 | ==================
51 |
52 | * Added optional callbacks
53 | * Added parsing of version
54 |
55 | 1.0.1 / 2010-03-26
56 | ==================
57 |
58 | * Fixed; sys.exec -> child_process.exec to support latest node
59 |
60 | 1.0.0 / 2010-03-19
61 | ==================
62 |
63 | * Initial release
64 |
--------------------------------------------------------------------------------
/spec/node_modules/chai/lib/chai/error.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * chai
3 | * Copyright(c) 2011-2013 Jake Luer
4 | * MIT Licensed
5 | */
6 |
7 | /*!
8 | * Main export
9 | */
10 |
11 | module.exports = AssertionError;
12 |
13 | /**
14 | * # AssertionError (constructor)
15 | *
16 | * Create a new assertion error based on the Javascript
17 | * `Error` prototype.
18 | *
19 | * **Options**
20 | * - message
21 | * - actual
22 | * - expected
23 | * - operator
24 | * - startStackFunction
25 | *
26 | * @param {Object} options
27 | * @api public
28 | */
29 |
30 | function AssertionError (options) {
31 | options = options || {};
32 | this.message = options.message;
33 | this.actual = options.actual;
34 | this.expected = options.expected;
35 | this.operator = options.operator;
36 | this.showDiff = options.showDiff;
37 |
38 | if (options.stackStartFunction && Error.captureStackTrace) {
39 | var stackStartFunction = options.stackStartFunction;
40 | Error.captureStackTrace(this, stackStartFunction);
41 | }
42 | }
43 |
44 | /*!
45 | * Inherit from Error
46 | */
47 |
48 | AssertionError.prototype = Object.create(Error.prototype);
49 | AssertionError.prototype.name = 'AssertionError';
50 | AssertionError.prototype.constructor = AssertionError;
51 |
52 | /**
53 | * # toString()
54 | *
55 | * Override default to string method
56 | */
57 |
58 | AssertionError.prototype.toString = function() {
59 | return this.message;
60 | };
61 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/lib/reporters/json.js:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * Module dependencies.
4 | */
5 |
6 | var Base = require('./base')
7 | , cursor = Base.cursor
8 | , color = Base.color;
9 |
10 | /**
11 | * Expose `JSON`.
12 | */
13 |
14 | exports = module.exports = JSONReporter;
15 |
16 | /**
17 | * Initialize a new `JSON` reporter.
18 | *
19 | * @param {Runner} runner
20 | * @api public
21 | */
22 |
23 | function JSONReporter(runner) {
24 | var self = this;
25 | Base.call(this, runner);
26 |
27 | var tests = []
28 | , failures = []
29 | , passes = [];
30 |
31 | runner.on('test end', function(test){
32 | tests.push(test);
33 | });
34 |
35 | runner.on('pass', function(test){
36 | passes.push(test);
37 | });
38 |
39 | runner.on('fail', function(test){
40 | failures.push(test);
41 | });
42 |
43 | runner.on('end', function(){
44 | var obj = {
45 | stats: self.stats
46 | , tests: tests.map(clean)
47 | , failures: failures.map(clean)
48 | , passes: passes.map(clean)
49 | };
50 |
51 | process.stdout.write(JSON.stringify(obj, null, 2));
52 | });
53 | }
54 |
55 | /**
56 | * Return a plain-object representation of `test`
57 | * free of cyclic properties etc.
58 | *
59 | * @param {Object} test
60 | * @return {Object}
61 | * @api private
62 | */
63 |
64 | function clean(test) {
65 | return {
66 | title: test.title
67 | , fullTitle: test.fullTitle()
68 | , duration: test.duration
69 | }
70 | }
--------------------------------------------------------------------------------
/spec/node_modules/mocha/lib/reporters/dot.js:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * Module dependencies.
4 | */
5 |
6 | var Base = require('./base')
7 | , color = Base.color;
8 |
9 | /**
10 | * Expose `Dot`.
11 | */
12 |
13 | exports = module.exports = Dot;
14 |
15 | /**
16 | * Initialize a new `Dot` matrix test reporter.
17 | *
18 | * @param {Runner} runner
19 | * @api public
20 | */
21 |
22 | function Dot(runner) {
23 | Base.call(this, runner);
24 |
25 | var self = this
26 | , stats = this.stats
27 | , width = Base.window.width * .75 | 0
28 | , n = 0;
29 |
30 | runner.on('start', function(){
31 | process.stdout.write('\n ');
32 | });
33 |
34 | runner.on('pending', function(test){
35 | process.stdout.write(color('pending', Base.symbols.dot));
36 | });
37 |
38 | runner.on('pass', function(test){
39 | if (++n % width == 0) process.stdout.write('\n ');
40 | if ('slow' == test.speed) {
41 | process.stdout.write(color('bright yellow', Base.symbols.dot));
42 | } else {
43 | process.stdout.write(color(test.speed, Base.symbols.dot));
44 | }
45 | });
46 |
47 | runner.on('fail', function(test, err){
48 | if (++n % width == 0) process.stdout.write('\n ');
49 | process.stdout.write(color('fail', Base.symbols.dot));
50 | });
51 |
52 | runner.on('end', function(){
53 | console.log();
54 | self.epilogue();
55 | });
56 | }
57 |
58 | /**
59 | * Inherit from `Base.prototype`.
60 | */
61 |
62 | Dot.prototype.__proto__ = Base.prototype;
--------------------------------------------------------------------------------
/spec/node_modules/chai/lib/chai.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * chai
3 | * Copyright(c) 2011-2013 Jake Luer
4 | * MIT Licensed
5 | */
6 |
7 | var used = []
8 | , exports = module.exports = {};
9 |
10 | /*!
11 | * Chai version
12 | */
13 |
14 | exports.version = '1.5.0';
15 |
16 | /*!
17 | * Primary `Assertion` prototype
18 | */
19 |
20 | exports.Assertion = require('./chai/assertion');
21 |
22 | /*!
23 | * Assertion Error
24 | */
25 |
26 | exports.AssertionError = require('./chai/error');
27 |
28 | /*!
29 | * Utils for plugins (not exported)
30 | */
31 |
32 | var util = require('./chai/utils');
33 |
34 | /**
35 | * # .use(function)
36 | *
37 | * Provides a way to extend the internals of Chai
38 | *
39 | * @param {Function}
40 | * @returns {this} for chaining
41 | * @api public
42 | */
43 |
44 | exports.use = function (fn) {
45 | if (!~used.indexOf(fn)) {
46 | fn(this, util);
47 | used.push(fn);
48 | }
49 |
50 | return this;
51 | };
52 |
53 | /*!
54 | * Core Assertions
55 | */
56 |
57 | var core = require('./chai/core/assertions');
58 | exports.use(core);
59 |
60 | /*!
61 | * Expect interface
62 | */
63 |
64 | var expect = require('./chai/interface/expect');
65 | exports.use(expect);
66 |
67 | /*!
68 | * Should interface
69 | */
70 |
71 | var should = require('./chai/interface/should');
72 | exports.use(should);
73 |
74 | /*!
75 | * Assert interface
76 | */
77 |
78 | var assert = require('./chai/interface/assert');
79 | exports.use(assert);
80 |
--------------------------------------------------------------------------------
/spec/node_modules/chai/lib/chai/utils/getMessage.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * Chai - message composition utility
3 | * Copyright(c) 2012-2013 Jake Luer
4 | * MIT Licensed
5 | */
6 |
7 | /*!
8 | * Module dependancies
9 | */
10 |
11 | var flag = require('./flag')
12 | , getActual = require('./getActual')
13 | , inspect = require('./inspect')
14 | , objDisplay = require('./objDisplay');
15 |
16 | /**
17 | * ### .getMessage(object, message, negateMessage)
18 | *
19 | * Construct the error message based on flags
20 | * and template tags. Template tags will return
21 | * a stringified inspection of the object referenced.
22 | *
23 | * Messsage template tags:
24 | * - `#{this}` current asserted object
25 | * - `#{act}` actual value
26 | * - `#{exp}` expected value
27 | *
28 | * @param {Object} object (constructed Assertion)
29 | * @param {Arguments} chai.Assertion.prototype.assert arguments
30 | * @name getMessage
31 | * @api public
32 | */
33 |
34 | module.exports = function (obj, args) {
35 | var negate = flag(obj, 'negate')
36 | , val = flag(obj, 'object')
37 | , expected = args[3]
38 | , actual = getActual(obj, args)
39 | , msg = negate ? args[2] : args[1]
40 | , flagMsg = flag(obj, 'message');
41 |
42 | msg = msg || '';
43 | msg = msg
44 | .replace(/#{this}/g, objDisplay(val))
45 | .replace(/#{act}/g, objDisplay(actual))
46 | .replace(/#{exp}/g, objDisplay(expected));
47 |
48 | return flagMsg ? flagMsg + ': ' + msg : msg;
49 | };
50 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/mkdirp/README.markdown:
--------------------------------------------------------------------------------
1 | mkdirp
2 | ======
3 |
4 | Like `mkdir -p`, but in node.js!
5 |
6 | [](http://travis-ci.org/substack/node-mkdirp)
7 |
8 | example
9 | =======
10 |
11 | pow.js
12 | ------
13 | var mkdirp = require('mkdirp');
14 |
15 | mkdirp('/tmp/foo/bar/baz', function (err) {
16 | if (err) console.error(err)
17 | else console.log('pow!')
18 | });
19 |
20 | Output
21 | pow!
22 |
23 | And now /tmp/foo/bar/baz exists, huzzah!
24 |
25 | methods
26 | =======
27 |
28 | var mkdirp = require('mkdirp');
29 |
30 | mkdirp(dir, mode, cb)
31 | ---------------------
32 |
33 | Create a new directory and any necessary subdirectories at `dir` with octal
34 | permission string `mode`.
35 |
36 | If `mode` isn't specified, it defaults to `0777 & (~process.umask())`.
37 |
38 | `cb(err, made)` fires with the error or the first directory `made`
39 | that had to be created, if any.
40 |
41 | mkdirp.sync(dir, mode)
42 | ----------------------
43 |
44 | Synchronously create a new directory and any necessary subdirectories at `dir`
45 | with octal permission string `mode`.
46 |
47 | If `mode` isn't specified, it defaults to `0777 & (~process.umask())`.
48 |
49 | Returns the first directory that had to be created, if any.
50 |
51 | install
52 | =======
53 |
54 | With [npm](http://npmjs.org) do:
55 |
56 | npm install mkdirp
57 |
58 | license
59 | =======
60 |
61 | MIT/X11
62 |
--------------------------------------------------------------------------------
/spec/node_modules/chai/lib/chai/utils/transferFlags.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * Chai - transferFlags utility
3 | * Copyright(c) 2012-2013 Jake Luer
4 | * MIT Licensed
5 | */
6 |
7 | /**
8 | * ### transferFlags(assertion, object, includeAll = true)
9 | *
10 | * Transfer all the flags for `assertion` to `object`. If
11 | * `includeAll` is set to `false`, then the base Chai
12 | * assertion flags (namely `object`, `ssfi`, and `message`)
13 | * will not be transferred.
14 | *
15 | *
16 | * var newAssertion = new Assertion();
17 | * utils.transferFlags(assertion, newAssertion);
18 | *
19 | * var anotherAsseriton = new Assertion(myObj);
20 | * utils.transferFlags(assertion, anotherAssertion, false);
21 | *
22 | * @param {Assertion} assertion the assertion to transfer the flags from
23 | * @param {Object} object the object to transfer the flags too; usually a new assertion
24 | * @param {Boolean} includeAll
25 | * @name getAllFlags
26 | * @api private
27 | */
28 |
29 | module.exports = function (assertion, object, includeAll) {
30 | var flags = assertion.__flags || (assertion.__flags = Object.create(null));
31 |
32 | if (!object.__flags) {
33 | object.__flags = Object.create(null);
34 | }
35 |
36 | includeAll = arguments.length === 3 ? includeAll : true;
37 |
38 | for (var flag in flags) {
39 | if (includeAll ||
40 | (flag !== 'object' && flag !== 'ssfi' && flag != 'message')) {
41 | object.__flags[flag] = flags[flag];
42 | }
43 | }
44 | };
45 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/lib/reporters/list.js:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * Module dependencies.
4 | */
5 |
6 | var Base = require('./base')
7 | , cursor = Base.cursor
8 | , color = Base.color;
9 |
10 | /**
11 | * Expose `List`.
12 | */
13 |
14 | exports = module.exports = List;
15 |
16 | /**
17 | * Initialize a new `List` test reporter.
18 | *
19 | * @param {Runner} runner
20 | * @api public
21 | */
22 |
23 | function List(runner) {
24 | Base.call(this, runner);
25 |
26 | var self = this
27 | , stats = this.stats
28 | , n = 0;
29 |
30 | runner.on('start', function(){
31 | console.log();
32 | });
33 |
34 | runner.on('test', function(test){
35 | process.stdout.write(color('pass', ' ' + test.fullTitle() + ': '));
36 | });
37 |
38 | runner.on('pending', function(test){
39 | var fmt = color('checkmark', ' -')
40 | + color('pending', ' %s');
41 | console.log(fmt, test.fullTitle());
42 | });
43 |
44 | runner.on('pass', function(test){
45 | var fmt = color('checkmark', ' '+Base.symbols.dot)
46 | + color('pass', ' %s: ')
47 | + color(test.speed, '%dms');
48 | cursor.CR();
49 | console.log(fmt, test.fullTitle(), test.duration);
50 | });
51 |
52 | runner.on('fail', function(test, err){
53 | cursor.CR();
54 | console.log(color('fail', ' %d) %s'), ++n, test.fullTitle());
55 | });
56 |
57 | runner.on('end', self.epilogue.bind(self));
58 | }
59 |
60 | /**
61 | * Inherit from `Base.prototype`.
62 | */
63 |
64 | List.prototype.__proto__ = Base.prototype;
65 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/lib/interfaces/exports.js:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * Module dependencies.
4 | */
5 |
6 | var Suite = require('../suite')
7 | , Test = require('../test');
8 |
9 | /**
10 | * TDD-style interface:
11 | *
12 | * exports.Array = {
13 | * '#indexOf()': {
14 | * 'should return -1 when the value is not present': function(){
15 | *
16 | * },
17 | *
18 | * 'should return the correct index when the value is present': function(){
19 | *
20 | * }
21 | * }
22 | * };
23 | *
24 | */
25 |
26 | module.exports = function(suite){
27 | var suites = [suite];
28 |
29 | suite.on('require', visit);
30 |
31 | function visit(obj) {
32 | var suite;
33 | for (var key in obj) {
34 | if ('function' == typeof obj[key]) {
35 | var fn = obj[key];
36 | switch (key) {
37 | case 'before':
38 | suites[0].beforeAll(fn);
39 | break;
40 | case 'after':
41 | suites[0].afterAll(fn);
42 | break;
43 | case 'beforeEach':
44 | suites[0].beforeEach(fn);
45 | break;
46 | case 'afterEach':
47 | suites[0].afterEach(fn);
48 | break;
49 | default:
50 | suites[0].addTest(new Test(key, fn));
51 | }
52 | } else {
53 | var suite = Suite.create(suites[0], key);
54 | suites.unshift(suite);
55 | visit(obj[key]);
56 | suites.shift();
57 | }
58 | }
59 | }
60 | };
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/diff/style.css:
--------------------------------------------------------------------------------
1 | * {
2 | margin: 0;
3 | padding: 0;
4 | }
5 | html, body {
6 | background: #EEE;
7 | font: 12px sans-serif;
8 | }
9 | body {
10 | padding-top: 1.8em;
11 | -webkit-box-sizing: border-box;
12 | -moz-box-sizing: border-box;
13 | box-sizing: border-box;
14 | }
15 | html, body, table, tbody, tr, td {
16 | height: 100%
17 | }
18 | table {
19 | table-layout: fixed;
20 | width: 100%;
21 | }
22 | td {
23 | width: 33%;
24 | padding: 3px 4px;
25 | border: 1px solid transparent;
26 | vertical-align: top;
27 | font: 1em monospace;
28 | text-align: left;
29 | white-space: pre-wrap;
30 | }
31 | h1 {
32 | display: inline;
33 | font-size: 100%;
34 | }
35 | del {
36 | text-decoration: none;
37 | color: #b30000;
38 | background: #fadad7;
39 | }
40 | ins {
41 | background: #eaf2c2;
42 | color: #406619;
43 | text-decoration: none;
44 | }
45 |
46 | #settings {
47 | position: absolute;
48 | top: 0;
49 | left: 5px;
50 | right: 5px;
51 | height: 2em;
52 | line-height: 2em;
53 | }
54 | #settings label {
55 | margin-left: 1em;
56 | }
57 |
58 | .source {
59 | position: absolute;
60 | right: 1%;
61 | top: .2em;
62 | }
63 |
64 | [contentEditable] {
65 | background: #F9F9F9;
66 | border-color: #BBB #D9D9D9 #DDD;
67 | border-radius: 4px;
68 | -webkit-user-modify: read-write-plaintext-only;
69 | outline: none;
70 | }
71 | [contentEditable]:focus {
72 | background: #FFF;
73 | border-color: #6699cc;
74 | box-shadow: 0 0 4px #2175c9;
75 | }
76 |
77 | @-moz-document url-prefix() {
78 | body {
79 | height: 99%; /* Hide scroll bar in Firefox */
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/lib/reporters/templates/coverage.jade:
--------------------------------------------------------------------------------
1 | !!! 5
2 | html
3 | head
4 | title Coverage
5 | include script.html
6 | include style.html
7 | body
8 | #coverage
9 | h1#overview Coverage
10 | include menu
11 |
12 | #stats(class=coverageClass(cov.coverage))
13 | .percentage #{cov.coverage | 0}%
14 | .sloc= cov.sloc
15 | .hits= cov.hits
16 | .misses= cov.misses
17 |
18 | #files
19 | for file in cov.files
20 | .file
21 | h2(id=file.filename)= file.filename
22 | #stats(class=coverageClass(file.coverage))
23 | .percentage #{file.coverage | 0}%
24 | .sloc= file.sloc
25 | .hits= file.hits
26 | .misses= file.misses
27 |
28 | table#source
29 | thead
30 | tr
31 | th Line
32 | th Hits
33 | th Source
34 | tbody
35 | for line, number in file.source
36 | if line.coverage > 0
37 | tr.hit
38 | td.line= number
39 | td.hits= line.coverage
40 | td.source= line.source
41 | else if 0 === line.coverage
42 | tr.miss
43 | td.line= number
44 | td.hits 0
45 | td.source= line.source
46 | else
47 | tr
48 | td.line= number
49 | td.hits
50 | td.source= line.source || ' '
--------------------------------------------------------------------------------
/spec/node_modules/mocha/lib/reporters/tap.js:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * Module dependencies.
4 | */
5 |
6 | var Base = require('./base')
7 | , cursor = Base.cursor
8 | , color = Base.color;
9 |
10 | /**
11 | * Expose `TAP`.
12 | */
13 |
14 | exports = module.exports = TAP;
15 |
16 | /**
17 | * Initialize a new `TAP` reporter.
18 | *
19 | * @param {Runner} runner
20 | * @api public
21 | */
22 |
23 | function TAP(runner) {
24 | Base.call(this, runner);
25 |
26 | var self = this
27 | , stats = this.stats
28 | , n = 1
29 | , passes = 0
30 | , failures = 0;
31 |
32 | runner.on('start', function(){
33 | var total = runner.grepTotal(runner.suite);
34 | console.log('%d..%d', 1, total);
35 | });
36 |
37 | runner.on('test end', function(){
38 | ++n;
39 | });
40 |
41 | runner.on('pending', function(test){
42 | console.log('ok %d %s # SKIP -', n, title(test));
43 | });
44 |
45 | runner.on('pass', function(test){
46 | passes++;
47 | console.log('ok %d %s', n, title(test));
48 | });
49 |
50 | runner.on('fail', function(test, err){
51 | failures++;
52 | console.log('not ok %d %s', n, title(test));
53 | if (err.stack) console.log(err.stack.replace(/^/gm, ' '));
54 | });
55 |
56 | runner.on('end', function(){
57 | console.log('# tests ' + (passes + failures));
58 | console.log('# pass ' + passes);
59 | console.log('# fail ' + failures);
60 | });
61 | }
62 |
63 | /**
64 | * Return a TAP-safe title of `test`
65 | *
66 | * @param {Object} test
67 | * @return {String}
68 | * @api private
69 | */
70 |
71 | function title(test) {
72 | return test.fullTitle().replace(/#/g, '');
73 | }
74 |
--------------------------------------------------------------------------------
/spec/node_modules/chai/lib/chai/utils/overwriteMethod.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * Chai - overwriteMethod utility
3 | * Copyright(c) 2012-2013 Jake Luer
4 | * MIT Licensed
5 | */
6 |
7 | /**
8 | * ### overwriteMethod (ctx, name, fn)
9 | *
10 | * Overwites an already existing method and provides
11 | * access to previous function. Must return function
12 | * to be used for name.
13 | *
14 | * utils.overwriteMethod(chai.Assertion.prototype, 'equal', function (_super) {
15 | * return function (str) {
16 | * var obj = utils.flag(this, 'object');
17 | * if (obj instanceof Foo) {
18 | * new chai.Assertion(obj.value).to.equal(str);
19 | * } else {
20 | * _super.apply(this, arguments);
21 | * }
22 | * }
23 | * });
24 | *
25 | * Can also be accessed directly from `chai.Assertion`.
26 | *
27 | * chai.Assertion.overwriteMethod('foo', fn);
28 | *
29 | * Then can be used as any other assertion.
30 | *
31 | * expect(myFoo).to.equal('bar');
32 | *
33 | * @param {Object} ctx object whose method is to be overwritten
34 | * @param {String} name of method to overwrite
35 | * @param {Function} method function that returns a function to be used for name
36 | * @name overwriteMethod
37 | * @api public
38 | */
39 |
40 | module.exports = function (ctx, name, method) {
41 | var _method = ctx[name]
42 | , _super = function () { return this; };
43 |
44 | if (_method && 'function' === typeof _method)
45 | _super = _method;
46 |
47 | ctx[name] = function () {
48 | var result = method(_super).apply(this, arguments);
49 | return result === undefined ? this : result;
50 | }
51 | };
52 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/diff/LICENSE:
--------------------------------------------------------------------------------
1 | Software License Agreement (BSD License)
2 |
3 | Copyright (c) 2009-2011, Kevin Decker
4 |
5 | All rights reserved.
6 |
7 | Redistribution and use of this software in source and binary forms, with or without modification,
8 | are permitted provided that the following conditions are met:
9 |
10 | * Redistributions of source code must retain the above
11 | copyright notice, this list of conditions and the
12 | following disclaimer.
13 |
14 | * Redistributions in binary form must reproduce the above
15 | copyright notice, this list of conditions and the
16 | following disclaimer in the documentation and/or other
17 | materials provided with the distribution.
18 |
19 | * Neither the name of Kevin Decker nor the names of its
20 | contributors may be used to endorse or promote products
21 | derived from this software without specific prior
22 | written permission.
23 |
24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
25 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
26 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
27 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
30 | IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
31 | OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------
/SpecRunner.html:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 | Jasmine Spec Runner
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/debug/History.md:
--------------------------------------------------------------------------------
1 |
2 | 0.7.2 / 2013-02-06
3 | ==================
4 |
5 | * fix package.json
6 | * fix: Mobile Safari (private mode) is broken with debug
7 | * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript
8 |
9 | 0.7.1 / 2013-02-05
10 | ==================
11 |
12 | * add repository URL to package.json
13 | * add DEBUG_COLORED to force colored output
14 | * add browserify support
15 | * fix component. Closes #24
16 |
17 | 0.7.0 / 2012-05-04
18 | ==================
19 |
20 | * Added .component to package.json
21 | * Added debug.component.js build
22 |
23 | 0.6.0 / 2012-03-16
24 | ==================
25 |
26 | * Added support for "-" prefix in DEBUG [Vinay Pulim]
27 | * Added `.enabled` flag to the node version [TooTallNate]
28 |
29 | 0.5.0 / 2012-02-02
30 | ==================
31 |
32 | * Added: humanize diffs. Closes #8
33 | * Added `debug.disable()` to the CS variant
34 | * Removed padding. Closes #10
35 | * Fixed: persist client-side variant again. Closes #9
36 |
37 | 0.4.0 / 2012-02-01
38 | ==================
39 |
40 | * Added browser variant support for older browsers [TooTallNate]
41 | * Added `debug.enable('project:*')` to browser variant [TooTallNate]
42 | * Added padding to diff (moved it to the right)
43 |
44 | 0.3.0 / 2012-01-26
45 | ==================
46 |
47 | * Added millisecond diff when isatty, otherwise UTC string
48 |
49 | 0.2.0 / 2012-01-22
50 | ==================
51 |
52 | * Added wildcard support
53 |
54 | 0.1.0 / 2011-12-02
55 | ==================
56 |
57 | * Added: remove colors unless stderr isatty [TooTallNate]
58 |
59 | 0.0.1 / 2010-01-03
60 | ==================
61 |
62 | * Initial release
63 |
--------------------------------------------------------------------------------
/spec/node_modules/chai/lib/chai/utils/overwriteProperty.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * Chai - overwriteProperty utility
3 | * Copyright(c) 2012-2013 Jake Luer
4 | * MIT Licensed
5 | */
6 |
7 | /**
8 | * ### overwriteProperty (ctx, name, fn)
9 | *
10 | * Overwites an already existing property getter and provides
11 | * access to previous value. Must return function to use as getter.
12 | *
13 | * utils.overwriteProperty(chai.Assertion.prototype, 'ok', function (_super) {
14 | * return function () {
15 | * var obj = utils.flag(this, 'object');
16 | * if (obj instanceof Foo) {
17 | * new chai.Assertion(obj.name).to.equal('bar');
18 | * } else {
19 | * _super.call(this);
20 | * }
21 | * }
22 | * });
23 | *
24 | *
25 | * Can also be accessed directly from `chai.Assertion`.
26 | *
27 | * chai.Assertion.overwriteProperty('foo', fn);
28 | *
29 | * Then can be used as any other assertion.
30 | *
31 | * expect(myFoo).to.be.ok;
32 | *
33 | * @param {Object} ctx object whose property is to be overwritten
34 | * @param {String} name of property to overwrite
35 | * @param {Function} getter function that returns a getter function to be used for name
36 | * @name overwriteProperty
37 | * @api public
38 | */
39 |
40 | module.exports = function (ctx, name, getter) {
41 | var _get = Object.getOwnPropertyDescriptor(ctx, name)
42 | , _super = function () {};
43 |
44 | if (_get && 'function' === typeof _get.get)
45 | _super = _get.get
46 |
47 | Object.defineProperty(ctx, name,
48 | { get: function () {
49 | var result = getter(_super).call(this);
50 | return result === undefined ? this : result;
51 | }
52 | , configurable: true
53 | });
54 | };
55 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/node_modules/mkdirp/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "mkdirp",
3 | "description": "Recursively mkdir, like `mkdir -p`",
4 | "version": "0.3.0",
5 | "author": {
6 | "name": "James Halliday",
7 | "email": "mail@substack.net",
8 | "url": "http://substack.net"
9 | },
10 | "main": "./index",
11 | "keywords": [
12 | "mkdir",
13 | "directory"
14 | ],
15 | "repository": {
16 | "type": "git",
17 | "url": "http://github.com/substack/node-mkdirp.git"
18 | },
19 | "scripts": {
20 | "test": "tap test/*.js"
21 | },
22 | "devDependencies": {
23 | "tap": "0.0.x"
24 | },
25 | "license": "MIT/X11",
26 | "engines": {
27 | "node": "*"
28 | },
29 | "readme": "mkdirp\n======\n\nLike `mkdir -p`, but in node.js!\n\nexample\n=======\n\npow.js\n------\n var mkdirp = require('mkdirp');\n \n mkdirp('/tmp/foo/bar/baz', function (err) {\n if (err) console.error(err)\n else console.log('pow!')\n });\n\nOutput\n pow!\n\nAnd now /tmp/foo/bar/baz exists, huzzah!\n\nmethods\n=======\n\nvar mkdirp = require('mkdirp');\n\nmkdirp(dir, mode, cb)\n---------------------\n\nCreate a new directory and any necessary subdirectories at `dir` with octal\npermission string `mode`.\n\nIf `mode` isn't specified, it defaults to `0777 & (~process.umask())`.\n\nmkdirp.sync(dir, mode)\n----------------------\n\nSynchronously create a new directory and any necessary subdirectories at `dir`\nwith octal permission string `mode`.\n\nIf `mode` isn't specified, it defaults to `0777 & (~process.umask())`.\n\ninstall\n=======\n\nWith [npm](http://npmjs.org) do:\n\n npm install mkdirp\n\nlicense\n=======\n\nMIT/X11\n",
30 | "readmeFilename": "README.markdown",
31 | "_id": "mkdirp@0.3.0",
32 | "_from": "mkdirp@0.3.0"
33 | }
34 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/runtime.min.js:
--------------------------------------------------------------------------------
1 | jade=function(exports){Array.isArray||(Array.isArray=function(arr){return"[object Array]"==Object.prototype.toString.call(arr)}),Object.keys||(Object.keys=function(obj){var arr=[];for(var key in obj)obj.hasOwnProperty(key)&&arr.push(key);return arr}),exports.merge=function merge(a,b){var ac=a["class"],bc=b["class"];if(ac||bc)ac=ac||[],bc=bc||[],Array.isArray(ac)||(ac=[ac]),Array.isArray(bc)||(bc=[bc]),ac=ac.filter(nulls),bc=bc.filter(nulls),a["class"]=ac.concat(bc).join(" ");for(var key in b)key!="class"&&(a[key]=b[key]);return a};function nulls(val){return val!=null}return exports.attrs=function attrs(obj,escaped){var buf=[],terse=obj.terse;delete obj.terse;var keys=Object.keys(obj),len=keys.length;if(len){buf.push("");for(var i=0;i/g,">").replace(/"/g,""")},exports.rethrow=function rethrow(err,filename,lineno){if(!filename)throw err;var context=3,str=require("fs").readFileSync(filename,"utf8"),lines=str.split("\n"),start=Math.max(lineno-context,0),end=Math.min(lines.length,lineno+context),context=lines.slice(start,end).map(function(line,i){var curr=i+start+1;return(curr==lineno?" > ":" ")+curr+"| "+line}).join("\n");throw err.path=filename,err.message=(filename||"Jade")+":"+lineno+"\n"+context+"\n\n"+err.message,err},exports}({});
--------------------------------------------------------------------------------
/spec/node_modules/mocha/lib/reporters/teamcity.js:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * Module dependencies.
4 | */
5 |
6 | var Base = require('./base');
7 |
8 | /**
9 | * Expose `Teamcity`.
10 | */
11 |
12 | exports = module.exports = Teamcity;
13 |
14 | /**
15 | * Initialize a new `Teamcity` reporter.
16 | *
17 | * @param {Runner} runner
18 | * @api public
19 | */
20 |
21 | function Teamcity(runner) {
22 | Base.call(this, runner);
23 | var stats = this.stats;
24 |
25 | runner.on('start', function() {
26 | console.log("##teamcity[testSuiteStarted name='mocha.suite']");
27 | });
28 |
29 | runner.on('test', function(test) {
30 | console.log("##teamcity[testStarted name='" + escape(test.fullTitle()) + "']");
31 | });
32 |
33 | runner.on('fail', function(test, err) {
34 | console.log("##teamcity[testFailed name='" + escape(test.fullTitle()) + "' message='" + escape(err.message) + "']");
35 | });
36 |
37 | runner.on('pending', function(test) {
38 | console.log("##teamcity[testIgnored name='" + escape(test.fullTitle()) + "' message='pending']");
39 | });
40 |
41 | runner.on('test end', function(test) {
42 | console.log("##teamcity[testFinished name='" + escape(test.fullTitle()) + "' duration='" + test.duration + "']");
43 | });
44 |
45 | runner.on('end', function() {
46 | console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='" + stats.duration + "']");
47 | });
48 | }
49 |
50 | /**
51 | * Escape the given `str`.
52 | */
53 |
54 | function escape(str) {
55 | return str
56 | .replace(/\|/g, "||")
57 | .replace(/\n/g, "|n")
58 | .replace(/\r/g, "|r")
59 | .replace(/\[/g, "|[")
60 | .replace(/\]/g, "|]")
61 | .replace(/\u0085/g, "|x")
62 | .replace(/\u2028/g, "|l")
63 | .replace(/\u2029/g, "|p")
64 | .replace(/'/g, "|'");
65 | }
66 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/lib/nodes/attrs.js:
--------------------------------------------------------------------------------
1 |
2 | /*!
3 | * Jade - nodes - Attrs
4 | * Copyright(c) 2010 TJ Holowaychuk
5 | * MIT Licensed
6 | */
7 |
8 | /**
9 | * Module dependencies.
10 | */
11 |
12 | var Node = require('./node'),
13 | Block = require('./block');
14 |
15 | /**
16 | * Initialize a `Attrs` node.
17 | *
18 | * @api public
19 | */
20 |
21 | var Attrs = module.exports = function Attrs() {
22 | this.attrs = [];
23 | };
24 |
25 | /**
26 | * Inherit from `Node`.
27 | */
28 |
29 | Attrs.prototype.__proto__ = Node.prototype;
30 |
31 | /**
32 | * Set attribute `name` to `val`, keep in mind these become
33 | * part of a raw js object literal, so to quote a value you must
34 | * '"quote me"', otherwise or example 'user.name' is literal JavaScript.
35 | *
36 | * @param {String} name
37 | * @param {String} val
38 | * @param {Boolean} escaped
39 | * @return {Tag} for chaining
40 | * @api public
41 | */
42 |
43 | Attrs.prototype.setAttribute = function(name, val, escaped){
44 | this.attrs.push({ name: name, val: val, escaped: escaped });
45 | return this;
46 | };
47 |
48 | /**
49 | * Remove attribute `name` when present.
50 | *
51 | * @param {String} name
52 | * @api public
53 | */
54 |
55 | Attrs.prototype.removeAttribute = function(name){
56 | for (var i = 0, len = this.attrs.length; i < len; ++i) {
57 | if (this.attrs[i] && this.attrs[i].name == name) {
58 | delete this.attrs[i];
59 | }
60 | }
61 | };
62 |
63 | /**
64 | * Get attribute value by `name`.
65 | *
66 | * @param {String} name
67 | * @return {String}
68 | * @api public
69 | */
70 |
71 | Attrs.prototype.getAttribute = function(name){
72 | for (var i = 0, len = this.attrs.length; i < len; ++i) {
73 | if (this.attrs[i] && this.attrs[i].name == name) {
74 | return this.attrs[i].val;
75 | }
76 | }
77 | };
78 |
--------------------------------------------------------------------------------
/compileNotes.js:
--------------------------------------------------------------------------------
1 | //Calculates the ending time of a musical expression
2 | var endTime = function (time, expr) {
3 | if (expr.tag === 'note') { return time + expr.dur; }
4 | else { return endTime(endTime(time, expr.left), expr.right); }
5 | };
6 |
7 | // reverses an abstract syntax tree of musical expressions
8 | var reverse = function(expr) {
9 | if ((expr.tag === 'note') || (expr.tag === 'par') ||
10 | (expr.tag === 'repeat')) return expr;
11 | else return {
12 | tag: 'seq',
13 | left: reverse(expr.right),
14 | right: reverse(expr.left)
15 | };
16 | };
17 |
18 | // Compiles a musical expression into notes
19 | var compile = function (musexpr, start) {
20 | var expr = [];
21 | start = start || 0;
22 | if (musexpr.tag === 'note') {
23 | expr.push({ tag:'note',
24 | pitch: musexpr.pitch,
25 | start: start,
26 | dur: musexpr.dur
27 | });
28 | } else if (musexpr.tag === 'rest') {
29 | expr.push(musexpr);
30 | } else if (musexpr.tag === 'seq') {
31 | compile(musexpr.left, start).forEach(function(x) {expr.push(x);});
32 | start = expr[expr.length-1].start + expr[expr.length-1].dur;
33 | compile(musexpr.right, start).forEach(function(x) {expr.push(x);});
34 | } else if (musexpr.tag === 'par') {
35 | compile(musexpr.left, start).forEach(function(x) {expr.push(x);});
36 | compile(musexpr.right, start).forEach(function(x) {expr.push(x);});
37 | } else if (musexpr.tag === 'repeat') {
38 | _(musexpr.count).times(function() {
39 | expr.push(musexpr.section);
40 | });
41 | }
42 | return expr;
43 | };
44 |
45 | var noteToMidi = function(note) {
46 | if (!/[A-G][0-8]/.test(note)) throw("Not a valid note! Must be a note between A0 and C8");
47 | var notes = {C: 0, D: 2, E:4, F: 5, G:7, A:9, B:11};
48 | var octave = parseInt(note[1], 10) + 1;
49 | return octave * 12 + notes[note[0]];
50 | };
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/ms/ms.js:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * Helpers.
4 | */
5 |
6 | var s = 1000;
7 | var m = s * 60;
8 | var h = m * 60;
9 | var d = h * 24;
10 |
11 | /**
12 | * Parse or format the given `val`.
13 | *
14 | * @param {String|Number} val
15 | * @return {String|Number}
16 | * @api public
17 | */
18 |
19 | module.exports = function(val){
20 | if ('string' == typeof val) return parse(val);
21 | return format(val);
22 | }
23 |
24 | /**
25 | * Parse the given `str` and return milliseconds.
26 | *
27 | * @param {String} str
28 | * @return {Number}
29 | * @api private
30 | */
31 |
32 | function parse(str) {
33 | var m = /^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(str);
34 | if (!m) return;
35 | var n = parseFloat(m[1]);
36 | var type = (m[2] || 'ms').toLowerCase();
37 | switch (type) {
38 | case 'years':
39 | case 'year':
40 | case 'y':
41 | return n * 31557600000;
42 | case 'days':
43 | case 'day':
44 | case 'd':
45 | return n * 86400000;
46 | case 'hours':
47 | case 'hour':
48 | case 'h':
49 | return n * 3600000;
50 | case 'minutes':
51 | case 'minute':
52 | case 'm':
53 | return n * 60000;
54 | case 'seconds':
55 | case 'second':
56 | case 's':
57 | return n * 1000;
58 | case 'ms':
59 | return n;
60 | }
61 | }
62 |
63 | /**
64 | * Format the given `ms`.
65 | *
66 | * @param {Number} ms
67 | * @return {String}
68 | * @api public
69 | */
70 |
71 | function format(ms) {
72 | if (ms == d) return (ms / d) + ' day';
73 | if (ms > d) return (ms / d) + ' days';
74 | if (ms == h) return (ms / h) + ' hour';
75 | if (ms > h) return (ms / h) + ' hours';
76 | if (ms == m) return (ms / m) + ' minute';
77 | if (ms > m) return (ms / m) + ' minutes';
78 | if (ms == s) return (ms / s) + ' second';
79 | if (ms > s) return (ms / s) + ' seconds';
80 | return ms + ' ms';
81 | }
--------------------------------------------------------------------------------
/spec/node_modules/chai/lib/chai/utils/index.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * chai
3 | * Copyright(c) 2011 Jake Luer
4 | * MIT Licensed
5 | */
6 |
7 | /*!
8 | * Main exports
9 | */
10 |
11 | var exports = module.exports = {};
12 |
13 | /*!
14 | * test utility
15 | */
16 |
17 | exports.test = require('./test');
18 |
19 | /*!
20 | * type utility
21 | */
22 |
23 | exports.type = require('./type');
24 |
25 | /*!
26 | * message utility
27 | */
28 |
29 | exports.getMessage = require('./getMessage');
30 |
31 | /*!
32 | * actual utility
33 | */
34 |
35 | exports.getActual = require('./getActual');
36 |
37 | /*!
38 | * Inspect util
39 | */
40 |
41 | exports.inspect = require('./inspect');
42 |
43 | /*!
44 | * Object Display util
45 | */
46 |
47 | exports.objDisplay = require('./objDisplay');
48 |
49 | /*!
50 | * Flag utility
51 | */
52 |
53 | exports.flag = require('./flag');
54 |
55 | /*!
56 | * Flag transferring utility
57 | */
58 |
59 | exports.transferFlags = require('./transferFlags');
60 |
61 | /*!
62 | * Deep equal utility
63 | */
64 |
65 | exports.eql = require('./eql');
66 |
67 | /*!
68 | * Deep path value
69 | */
70 |
71 | exports.getPathValue = require('./getPathValue');
72 |
73 | /*!
74 | * Function name
75 | */
76 |
77 | exports.getName = require('./getName');
78 |
79 | /*!
80 | * add Property
81 | */
82 |
83 | exports.addProperty = require('./addProperty');
84 |
85 | /*!
86 | * add Method
87 | */
88 |
89 | exports.addMethod = require('./addMethod');
90 |
91 | /*!
92 | * overwrite Property
93 | */
94 |
95 | exports.overwriteProperty = require('./overwriteProperty');
96 |
97 | /*!
98 | * overwrite Method
99 | */
100 |
101 | exports.overwriteMethod = require('./overwriteMethod');
102 |
103 | /*!
104 | * Add a chainable method
105 | */
106 |
107 | exports.addChainableMethod = require('./addChainableMethod');
108 |
109 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/lib/ms.js:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * Helpers.
4 | */
5 |
6 | var s = 1000;
7 | var m = s * 60;
8 | var h = m * 60;
9 | var d = h * 24;
10 |
11 | /**
12 | * Parse or format the given `val`.
13 | *
14 | * @param {String|Number} val
15 | * @return {String|Number}
16 | * @api public
17 | */
18 |
19 | module.exports = function(val){
20 | if ('string' == typeof val) return parse(val);
21 | return format(val);
22 | }
23 |
24 | /**
25 | * Parse the given `str` and return milliseconds.
26 | *
27 | * @param {String} str
28 | * @return {Number}
29 | * @api private
30 | */
31 |
32 | function parse(str) {
33 | var m = /^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(str);
34 | if (!m) return;
35 | var n = parseFloat(m[1]);
36 | var type = (m[2] || 'ms').toLowerCase();
37 | switch (type) {
38 | case 'years':
39 | case 'year':
40 | case 'y':
41 | return n * 31557600000;
42 | case 'days':
43 | case 'day':
44 | case 'd':
45 | return n * 86400000;
46 | case 'hours':
47 | case 'hour':
48 | case 'h':
49 | return n * 3600000;
50 | case 'minutes':
51 | case 'minute':
52 | case 'm':
53 | return n * 60000;
54 | case 'seconds':
55 | case 'second':
56 | case 's':
57 | return n * 1000;
58 | case 'ms':
59 | return n;
60 | }
61 | }
62 |
63 | /**
64 | * Format the given `ms`.
65 | *
66 | * @param {Number} ms
67 | * @return {String}
68 | * @api public
69 | */
70 |
71 | function format(ms) {
72 | if (ms == d) return Math.round(ms / d) + ' day';
73 | if (ms > d) return Math.round(ms / d) + ' days';
74 | if (ms == h) return Math.round(ms / h) + ' hour';
75 | if (ms > h) return Math.round(ms / h) + ' hours';
76 | if (ms == m) return Math.round(ms / m) + ' minute';
77 | if (ms > m) return Math.round(ms / m) + ' minutes';
78 | if (ms == s) return Math.round(ms / s) + ' second';
79 | if (ms > s) return Math.round(ms / s) + ' seconds';
80 | return ms + ' ms';
81 | }
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/mkdirp/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "mkdirp",
3 | "description": "Recursively mkdir, like `mkdir -p`",
4 | "version": "0.3.3",
5 | "author": {
6 | "name": "James Halliday",
7 | "email": "mail@substack.net",
8 | "url": "http://substack.net"
9 | },
10 | "main": "./index",
11 | "keywords": [
12 | "mkdir",
13 | "directory"
14 | ],
15 | "repository": {
16 | "type": "git",
17 | "url": "http://github.com/substack/node-mkdirp.git"
18 | },
19 | "scripts": {
20 | "test": "tap test/*.js"
21 | },
22 | "devDependencies": {
23 | "tap": "~0.2.4"
24 | },
25 | "license": "MIT/X11",
26 | "engines": {
27 | "node": "*"
28 | },
29 | "readme": "mkdirp\n======\n\nLike `mkdir -p`, but in node.js!\n\n[](http://travis-ci.org/substack/node-mkdirp)\n\nexample\n=======\n\npow.js\n------\n var mkdirp = require('mkdirp');\n \n mkdirp('/tmp/foo/bar/baz', function (err) {\n if (err) console.error(err)\n else console.log('pow!')\n });\n\nOutput\n pow!\n\nAnd now /tmp/foo/bar/baz exists, huzzah!\n\nmethods\n=======\n\nvar mkdirp = require('mkdirp');\n\nmkdirp(dir, mode, cb)\n---------------------\n\nCreate a new directory and any necessary subdirectories at `dir` with octal\npermission string `mode`.\n\nIf `mode` isn't specified, it defaults to `0777 & (~process.umask())`.\n\n`cb(err, made)` fires with the error or the first directory `made`\nthat had to be created, if any.\n\nmkdirp.sync(dir, mode)\n----------------------\n\nSynchronously create a new directory and any necessary subdirectories at `dir`\nwith octal permission string `mode`.\n\nIf `mode` isn't specified, it defaults to `0777 & (~process.umask())`.\n\nReturns the first directory that had to be created, if any.\n\ninstall\n=======\n\nWith [npm](http://npmjs.org) do:\n\n npm install mkdirp\n\nlicense\n=======\n\nMIT/X11\n",
30 | "readmeFilename": "README.markdown",
31 | "_id": "mkdirp@0.3.3",
32 | "_from": "mkdirp@0.3.3"
33 | }
34 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/lib/interfaces/qunit.js:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * Module dependencies.
4 | */
5 |
6 | var Suite = require('../suite')
7 | , Test = require('../test');
8 |
9 | /**
10 | * QUnit-style interface:
11 | *
12 | * suite('Array');
13 | *
14 | * test('#length', function(){
15 | * var arr = [1,2,3];
16 | * ok(arr.length == 3);
17 | * });
18 | *
19 | * test('#indexOf()', function(){
20 | * var arr = [1,2,3];
21 | * ok(arr.indexOf(1) == 0);
22 | * ok(arr.indexOf(2) == 1);
23 | * ok(arr.indexOf(3) == 2);
24 | * });
25 | *
26 | * suite('String');
27 | *
28 | * test('#length', function(){
29 | * ok('foo'.length == 3);
30 | * });
31 | *
32 | */
33 |
34 | module.exports = function(suite){
35 | var suites = [suite];
36 |
37 | suite.on('pre-require', function(context){
38 |
39 | /**
40 | * Execute before running tests.
41 | */
42 |
43 | context.before = function(fn){
44 | suites[0].beforeAll(fn);
45 | };
46 |
47 | /**
48 | * Execute after running tests.
49 | */
50 |
51 | context.after = function(fn){
52 | suites[0].afterAll(fn);
53 | };
54 |
55 | /**
56 | * Execute before each test case.
57 | */
58 |
59 | context.beforeEach = function(fn){
60 | suites[0].beforeEach(fn);
61 | };
62 |
63 | /**
64 | * Execute after each test case.
65 | */
66 |
67 | context.afterEach = function(fn){
68 | suites[0].afterEach(fn);
69 | };
70 |
71 | /**
72 | * Describe a "suite" with the given `title`.
73 | */
74 |
75 | context.suite = function(title){
76 | if (suites.length > 1) suites.shift();
77 | var suite = Suite.create(suites[0], title);
78 | suites.unshift(suite);
79 | };
80 |
81 | /**
82 | * Describe a specification or test-case
83 | * with the given `title` and callback `fn`
84 | * acting as a thunk.
85 | */
86 |
87 | context.test = function(title, fn){
88 | suites[0].addTest(new Test(title, fn));
89 | };
90 | });
91 | };
92 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/lib/reporters/landing.js:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * Module dependencies.
4 | */
5 |
6 | var Base = require('./base')
7 | , cursor = Base.cursor
8 | , color = Base.color;
9 |
10 | /**
11 | * Expose `Landing`.
12 | */
13 |
14 | exports = module.exports = Landing;
15 |
16 | /**
17 | * Airplane color.
18 | */
19 |
20 | Base.colors.plane = 0;
21 |
22 | /**
23 | * Airplane crash color.
24 | */
25 |
26 | Base.colors['plane crash'] = 31;
27 |
28 | /**
29 | * Runway color.
30 | */
31 |
32 | Base.colors.runway = 90;
33 |
34 | /**
35 | * Initialize a new `Landing` reporter.
36 | *
37 | * @param {Runner} runner
38 | * @api public
39 | */
40 |
41 | function Landing(runner) {
42 | Base.call(this, runner);
43 |
44 | var self = this
45 | , stats = this.stats
46 | , width = Base.window.width * .75 | 0
47 | , total = runner.total
48 | , stream = process.stdout
49 | , plane = color('plane', '✈')
50 | , crashed = -1
51 | , n = 0;
52 |
53 | function runway() {
54 | var buf = Array(width).join('-');
55 | return ' ' + color('runway', buf);
56 | }
57 |
58 | runner.on('start', function(){
59 | stream.write('\n ');
60 | cursor.hide();
61 | });
62 |
63 | runner.on('test end', function(test){
64 | // check if the plane crashed
65 | var col = -1 == crashed
66 | ? width * ++n / total | 0
67 | : crashed;
68 |
69 | // show the crash
70 | if ('failed' == test.state) {
71 | plane = color('plane crash', '✈');
72 | crashed = col;
73 | }
74 |
75 | // render landing strip
76 | stream.write('\u001b[4F\n\n');
77 | stream.write(runway());
78 | stream.write('\n ');
79 | stream.write(color('runway', Array(col).join('⋅')));
80 | stream.write(plane)
81 | stream.write(color('runway', Array(width - col).join('⋅') + '\n'));
82 | stream.write(runway());
83 | stream.write('\u001b[0m');
84 | });
85 |
86 | runner.on('end', function(){
87 | cursor.show();
88 | console.log();
89 | self.epilogue();
90 | });
91 | }
92 |
93 | /**
94 | * Inherit from `Base.prototype`.
95 | */
96 |
97 | Landing.prototype.__proto__ = Base.prototype;
--------------------------------------------------------------------------------
/spec/node_modules/mocha/lib/reporters/spec.js:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * Module dependencies.
4 | */
5 |
6 | var Base = require('./base')
7 | , cursor = Base.cursor
8 | , color = Base.color;
9 |
10 | /**
11 | * Expose `Spec`.
12 | */
13 |
14 | exports = module.exports = Spec;
15 |
16 | /**
17 | * Initialize a new `Spec` test reporter.
18 | *
19 | * @param {Runner} runner
20 | * @api public
21 | */
22 |
23 | function Spec(runner) {
24 | Base.call(this, runner);
25 |
26 | var self = this
27 | , stats = this.stats
28 | , indents = 0
29 | , n = 0;
30 |
31 | function indent() {
32 | return Array(indents).join(' ')
33 | }
34 |
35 | runner.on('start', function(){
36 | console.log();
37 | });
38 |
39 | runner.on('suite', function(suite){
40 | ++indents;
41 | console.log(color('suite', '%s%s'), indent(), suite.title);
42 | });
43 |
44 | runner.on('suite end', function(suite){
45 | --indents;
46 | if (1 == indents) console.log();
47 | });
48 |
49 | runner.on('test', function(test){
50 | process.stdout.write(indent() + color('pass', ' ◦ ' + test.title + ': '));
51 | });
52 |
53 | runner.on('pending', function(test){
54 | var fmt = indent() + color('pending', ' - %s');
55 | console.log(fmt, test.title);
56 | });
57 |
58 | runner.on('pass', function(test){
59 | if ('fast' == test.speed) {
60 | var fmt = indent()
61 | + color('checkmark', ' ' + Base.symbols.ok)
62 | + color('pass', ' %s ');
63 | cursor.CR();
64 | console.log(fmt, test.title);
65 | } else {
66 | var fmt = indent()
67 | + color('checkmark', ' ' + Base.symbols.ok)
68 | + color('pass', ' %s ')
69 | + color(test.speed, '(%dms)');
70 | cursor.CR();
71 | console.log(fmt, test.title, test.duration);
72 | }
73 | });
74 |
75 | runner.on('fail', function(test, err){
76 | cursor.CR();
77 | console.log(indent() + color('fail', ' %d) %s'), ++n, test.title);
78 | });
79 |
80 | runner.on('end', self.epilogue.bind(self));
81 | }
82 |
83 | /**
84 | * Inherit from `Base.prototype`.
85 | */
86 |
87 | Spec.prototype.__proto__ = Base.prototype;
88 |
--------------------------------------------------------------------------------
/robo.peg:
--------------------------------------------------------------------------------
1 | start =
2 | grammatical*
3 |
4 | expression =
5 | grammatical
6 | /mathExp
7 | /atom
8 | /"(" space* first:expression rest:spacedExpr* ")"
9 | { return [first].concat(rest) ;}
10 |
11 | grammatical =
12 | check
13 | /until
14 | /both
15 | /either
16 | /set
17 | /spacedCommand
18 | /comparison
19 |
20 | check =
21 | "check" space* c:spacedExpr space* "yes:"space* y:grammatical "no:"space* n:grammatical space*
22 | { return ["check", c, y, n]; }
23 |
24 | until =
25 | "until" spacedExpr spacedExpr
26 |
27 | both =
28 | "both:" a:spacedExpr "and:" b:spacedExpr
29 | { return ["both", a, b]; }
30 |
31 | either =
32 | "either:" a:spacedExpr "or:" b:spacedExpr
33 | { return ["either", a, b]; }
34 |
35 | set =
36 | "set" space+ a:atom ":" e:spacedExpr
37 | { return ["set", a, e]; }
38 |
39 | comparison =
40 | mx:mathExp space* "=" space* eq:mathExp
41 | { return ["=", mx, eq]; }
42 | /mx:mathExp space* "<" space* lt:mathExp
43 | { return ["<", mx, lt]; }
44 | /mx:mathExp space* ">" space* gt:mathExp
45 | { return [">", mx, gt]; }
46 | /mathExp
47 |
48 | spacedExpr =
49 | space* e:expression space*
50 | { return e; }
51 |
52 | bool =
53 | "true"
54 | /"false"
55 |
56 | validchar
57 | = [0-9a-zA-Z_?!\@#$%^&.]
58 |
59 | atom =
60 | chars:validchar+
61 | { return chars.join(""); }
62 |
63 | spacedCommand =
64 | space* c:command space*
65 | { return c; }
66 |
67 | space =
68 | " " / "\n" / "\t"
69 |
70 | command =
71 | "move" / "left" / "right" / "fire" / "idle"
72 |
73 | mathExp =
74 | additive
75 |
76 | additive =
77 | left:multiplicative space* "+" space* right:additive
78 | { return ["+", left, right]; }
79 | /left:multiplicative space* "-" space* right:additive
80 | { return ["-", left, right]; }
81 | / multiplicative
82 |
83 | multiplicative =
84 | left:primary space* "*" space* right:multiplicative
85 | { return ["*", left, right]; }
86 | /left:primary space* "/" space* right:multiplicative
87 | { return ["/", left, right]; }
88 | / primary
89 |
90 | primary
91 | = integer
92 | / "(" space* p:mathExp space* ")"
93 | { return p; }
94 | /atom
95 |
96 | integer =
97 | digits:[0-9]+
98 | { return parseInt(digits.join(""), 10); }
99 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/lib/reporters/progress.js:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * Module dependencies.
4 | */
5 |
6 | var Base = require('./base')
7 | , cursor = Base.cursor
8 | , color = Base.color;
9 |
10 | /**
11 | * Expose `Progress`.
12 | */
13 |
14 | exports = module.exports = Progress;
15 |
16 | /**
17 | * General progress bar color.
18 | */
19 |
20 | Base.colors.progress = 90;
21 |
22 | /**
23 | * Initialize a new `Progress` bar test reporter.
24 | *
25 | * @param {Runner} runner
26 | * @param {Object} options
27 | * @api public
28 | */
29 |
30 | function Progress(runner, options) {
31 | Base.call(this, runner);
32 |
33 | var self = this
34 | , options = options || {}
35 | , stats = this.stats
36 | , width = Base.window.width * .50 | 0
37 | , total = runner.total
38 | , complete = 0
39 | , max = Math.max;
40 |
41 | // default chars
42 | options.open = options.open || '[';
43 | options.complete = options.complete || '▬';
44 | options.incomplete = options.incomplete || Base.symbols.dot;
45 | options.close = options.close || ']';
46 | options.verbose = false;
47 |
48 | // tests started
49 | runner.on('start', function(){
50 | console.log();
51 | cursor.hide();
52 | });
53 |
54 | // tests complete
55 | runner.on('test end', function(){
56 | complete++;
57 | var incomplete = total - complete
58 | , percent = complete / total
59 | , n = width * percent | 0
60 | , i = width - n;
61 |
62 | cursor.CR();
63 | process.stdout.write('\u001b[J');
64 | process.stdout.write(color('progress', ' ' + options.open));
65 | process.stdout.write(Array(n).join(options.complete));
66 | process.stdout.write(Array(i).join(options.incomplete));
67 | process.stdout.write(color('progress', options.close));
68 | if (options.verbose) {
69 | process.stdout.write(color('progress', ' ' + complete + ' of ' + total));
70 | }
71 | });
72 |
73 | // tests are complete, output some stats
74 | // and the failures if any
75 | runner.on('end', function(){
76 | cursor.show();
77 | console.log();
78 | self.epilogue();
79 | });
80 | }
81 |
82 | /**
83 | * Inherit from `Base.prototype`.
84 | */
85 |
86 | Progress.prototype.__proto__ = Base.prototype;
87 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/lib/nodes/tag.js:
--------------------------------------------------------------------------------
1 |
2 | /*!
3 | * Jade - nodes - Tag
4 | * Copyright(c) 2010 TJ Holowaychuk
5 | * MIT Licensed
6 | */
7 |
8 | /**
9 | * Module dependencies.
10 | */
11 |
12 | var Attrs = require('./attrs'),
13 | Block = require('./block'),
14 | inlineTags = require('../inline-tags');
15 |
16 | /**
17 | * Initialize a `Tag` node with the given tag `name` and optional `block`.
18 | *
19 | * @param {String} name
20 | * @param {Block} block
21 | * @api public
22 | */
23 |
24 | var Tag = module.exports = function Tag(name, block) {
25 | this.name = name;
26 | this.attrs = [];
27 | this.block = block || new Block;
28 | };
29 |
30 | /**
31 | * Inherit from `Attrs`.
32 | */
33 |
34 | Tag.prototype.__proto__ = Attrs.prototype;
35 |
36 | /**
37 | * Clone this tag.
38 | *
39 | * @return {Tag}
40 | * @api private
41 | */
42 |
43 | Tag.prototype.clone = function(){
44 | var clone = new Tag(this.name, this.block.clone());
45 | clone.line = this.line;
46 | clone.attrs = this.attrs;
47 | clone.textOnly = this.textOnly;
48 | return clone;
49 | };
50 |
51 | /**
52 | * Check if this tag is an inline tag.
53 | *
54 | * @return {Boolean}
55 | * @api private
56 | */
57 |
58 | Tag.prototype.isInline = function(){
59 | return ~inlineTags.indexOf(this.name);
60 | };
61 |
62 | /**
63 | * Check if this tag's contents can be inlined. Used for pretty printing.
64 | *
65 | * @return {Boolean}
66 | * @api private
67 | */
68 |
69 | Tag.prototype.canInline = function(){
70 | var nodes = this.block.nodes;
71 |
72 | function isInline(node){
73 | // Recurse if the node is a block
74 | if (node.isBlock) return node.nodes.every(isInline);
75 | return node.isText || (node.isInline && node.isInline());
76 | }
77 |
78 | // Empty tag
79 | if (!nodes.length) return true;
80 |
81 | // Text-only or inline-only tag
82 | if (1 == nodes.length) return isInline(nodes[0]);
83 |
84 | // Multi-line inline-only tag
85 | if (this.block.nodes.every(isInline)) {
86 | for (var i = 1, len = nodes.length; i < len; ++i) {
87 | if (nodes[i-1].isText && nodes[i].isText)
88 | return false;
89 | }
90 | return true;
91 | }
92 |
93 | // Mixed tag
94 | return false;
95 | };
--------------------------------------------------------------------------------
/spec/node_modules/mocha/lib/reporters/markdown.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Module dependencies.
3 | */
4 |
5 | var Base = require('./base')
6 | , utils = require('../utils');
7 |
8 | /**
9 | * Expose `Markdown`.
10 | */
11 |
12 | exports = module.exports = Markdown;
13 |
14 | /**
15 | * Initialize a new `Markdown` reporter.
16 | *
17 | * @param {Runner} runner
18 | * @api public
19 | */
20 |
21 | function Markdown(runner) {
22 | Base.call(this, runner);
23 |
24 | var self = this
25 | , stats = this.stats
26 | , level = 0
27 | , buf = '';
28 |
29 | function title(str) {
30 | return Array(level).join('#') + ' ' + str;
31 | }
32 |
33 | function indent() {
34 | return Array(level).join(' ');
35 | }
36 |
37 | function mapTOC(suite, obj) {
38 | var ret = obj;
39 | obj = obj[suite.title] = obj[suite.title] || { suite: suite };
40 | suite.suites.forEach(function(suite){
41 | mapTOC(suite, obj);
42 | });
43 | return ret;
44 | }
45 |
46 | function stringifyTOC(obj, level) {
47 | ++level;
48 | var buf = '';
49 | var link;
50 | for (var key in obj) {
51 | if ('suite' == key) continue;
52 | if (key) link = ' - [' + key + '](#' + utils.slug(obj[key].suite.fullTitle()) + ')\n';
53 | if (key) buf += Array(level).join(' ') + link;
54 | buf += stringifyTOC(obj[key], level);
55 | }
56 | --level;
57 | return buf;
58 | }
59 |
60 | function generateTOC(suite) {
61 | var obj = mapTOC(suite, {});
62 | return stringifyTOC(obj, 0);
63 | }
64 |
65 | generateTOC(runner.suite);
66 |
67 | runner.on('suite', function(suite){
68 | ++level;
69 | var slug = utils.slug(suite.fullTitle());
70 | buf += '' + '\n';
71 | buf += title(suite.title) + '\n';
72 | });
73 |
74 | runner.on('suite end', function(suite){
75 | --level;
76 | });
77 |
78 | runner.on('pass', function(test){
79 | var code = utils.clean(test.fn.toString());
80 | buf += test.title + '.\n';
81 | buf += '\n```js\n';
82 | buf += code + '\n';
83 | buf += '```\n\n';
84 | });
85 |
86 | runner.on('end', function(){
87 | process.stdout.write('# TOC\n');
88 | process.stdout.write(generateTOC(runner.suite));
89 | process.stdout.write(buf);
90 | });
91 | }
--------------------------------------------------------------------------------
/spec/node_modules/mocha/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "mocha",
3 | "version": "1.8.1",
4 | "description": "simple, flexible, fun test framework",
5 | "keywords": [
6 | "mocha",
7 | "test",
8 | "bdd",
9 | "tdd",
10 | "tap"
11 | ],
12 | "author": {
13 | "name": "TJ Holowaychuk",
14 | "email": "tj@vision-media.ca"
15 | },
16 | "repository": {
17 | "type": "git",
18 | "url": "git://github.com/visionmedia/mocha.git"
19 | },
20 | "main": "./index",
21 | "bin": {
22 | "mocha": "./bin/mocha",
23 | "_mocha": "./bin/_mocha"
24 | },
25 | "engines": {
26 | "node": ">= 0.4.x"
27 | },
28 | "scripts": {
29 | "test": "make test-all"
30 | },
31 | "dependencies": {
32 | "commander": "0.6.1",
33 | "growl": "1.7.x",
34 | "jade": "0.26.3",
35 | "diff": "1.0.2",
36 | "debug": "*",
37 | "mkdirp": "0.3.3",
38 | "ms": "0.3.0"
39 | },
40 | "devDependencies": {
41 | "should": "*",
42 | "coffee-script": "1.2"
43 | },
44 | "readme": " [](http://travis-ci.org/visionmedia/mocha)\n\n [](http://visionmedia.github.com/mocha)\n\n Mocha is a simple, flexible, fun JavaScript test framework for node.js and the browser. For more information view the [documentation](http://visionmedia.github.com/mocha).\n\n## Contributors\n\n```\n\nproject : mocha\nrepo age : 1 year, 3 months\nactive : 233 days\ncommits : 1034\nfiles : 114\nauthors : \n 451\tTJ Holowaychuk 43.6%\n 389\tTj Holowaychuk 37.6%\n 31\tGuillermo Rauch 3.0%\n 13\tAttila Domokos 1.3%\n 8\tJo Liss 0.8%\n 7\tNathan Rajlich 0.7%\n 6\tJames Carr 0.6%\n 6\tBrendan Nee 0.6%\n 5\tJohn Firebaugh 0.5%\n 5\tAaron Heckmann 0.5%\n 4\tJoshua Krall 0.4%\n 4\tXavier Antoviaque 0.4%\n 4\thokaccha 0.4%\n```\n\n## Links\n\n - [Google Group](http://groups.google.com/group/mochajs)\n - [Wiki](https://github.com/visionmedia/mocha/wiki)\n - Mocha [Extensions and reporters](https://github.com/visionmedia/mocha/wiki)",
45 | "readmeFilename": "Readme.md",
46 | "_id": "mocha@1.8.1",
47 | "_from": "mocha"
48 | }
49 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/ms/test/test.js:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * Dependencies.
4 | */
5 |
6 | if ('undefined' != typeof require) {
7 | expect = require('expect.js');
8 | ms = require('../ms');
9 | }
10 |
11 | // strings
12 |
13 | describe('ms(string)', function(){
14 | it('should preserve ms', function () {
15 | expect(ms('100')).to.be(100);
16 | });
17 |
18 | it('should convert from m to ms', function () {
19 | expect(ms('1m')).to.be(60000);
20 | });
21 |
22 | it('should convert from h to ms', function () {
23 | expect(ms('1h')).to.be(3600000);
24 | });
25 |
26 | it('should convert d to ms', function () {
27 | expect(ms('2d')).to.be(172800000);
28 | });
29 |
30 | it('should convert s to ms', function () {
31 | expect(ms('1s')).to.be(1000);
32 | });
33 |
34 | it('should convert ms to ms', function () {
35 | expect(ms('100ms')).to.be(100);
36 | });
37 |
38 | it('should work with decimals', function () {
39 | expect(ms('1.5h')).to.be(5400000);
40 | });
41 |
42 | it('should return NaN if invalid', function () {
43 | expect(isNaN(ms('☃'))).to.be(true);
44 | });
45 |
46 | it('should be case-insensitive', function () {
47 | expect(ms('1.5H')).to.be(5400000);
48 | });
49 |
50 | it('should work with numbers starting with .', function () {
51 | expect(ms('.5ms')).to.be(.5);
52 | });
53 | })
54 |
55 | // numbers
56 |
57 | describe('ms(number)', function(){
58 | it('should support milliseconds', function(){
59 | expect(ms(500)).to.be('500 ms');
60 | })
61 |
62 | it('should support seconds', function(){
63 | expect(ms(1000)).to.be('1 second');
64 | expect(ms(1500)).to.be('1.5 seconds');
65 | expect(ms(10000)).to.be('10 seconds');
66 | })
67 |
68 | it('should support minutes', function(){
69 | expect(ms(60 * 1000)).to.be('1 minute');
70 | expect(ms(60 * 1500)).to.be('1.5 minutes');
71 | expect(ms(60 * 10000)).to.be('10 minutes');
72 | })
73 |
74 | it('should support hours', function(){
75 | expect(ms(60 * 60 * 1000)).to.be('1 hour');
76 | expect(ms(60 * 60 * 1500)).to.be('1.5 hours');
77 | expect(ms(60 * 60 * 10000)).to.be('10 hours');
78 | })
79 |
80 | it('should support days', function(){
81 | expect(ms(24 * 60 * 60 * 1000)).to.be('1 day');
82 | expect(ms(24 * 60 * 60 * 1500)).to.be('1.5 days');
83 | expect(ms(24 * 60 * 60 * 10000)).to.be('10 days');
84 | })
85 | })
--------------------------------------------------------------------------------
/spec/node_modules/chai/lib/chai/interface/should.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * chai
3 | * Copyright(c) 2011-2013 Jake Luer
4 | * MIT Licensed
5 | */
6 |
7 | module.exports = function (chai, util) {
8 | var Assertion = chai.Assertion;
9 |
10 | function loadShould () {
11 | // modify Object.prototype to have `should`
12 | Object.defineProperty(Object.prototype, 'should',
13 | {
14 | set: function (value) {
15 | // See https://github.com/chaijs/chai/issues/86: this makes
16 | // `whatever.should = someValue` actually set `someValue`, which is
17 | // especially useful for `global.should = require('chai').should()`.
18 | //
19 | // Note that we have to use [[DefineProperty]] instead of [[Put]]
20 | // since otherwise we would trigger this very setter!
21 | Object.defineProperty(this, 'should', {
22 | value: value,
23 | enumerable: true,
24 | configurable: true,
25 | writable: true
26 | });
27 | }
28 | , get: function(){
29 | if (this instanceof String || this instanceof Number) {
30 | return new Assertion(this.constructor(this));
31 | } else if (this instanceof Boolean) {
32 | return new Assertion(this == true);
33 | }
34 | return new Assertion(this);
35 | }
36 | , configurable: true
37 | });
38 |
39 | var should = {};
40 |
41 | should.equal = function (val1, val2, msg) {
42 | new Assertion(val1, msg).to.equal(val2);
43 | };
44 |
45 | should.Throw = function (fn, errt, errs, msg) {
46 | new Assertion(fn, msg).to.Throw(errt, errs);
47 | };
48 |
49 | should.exist = function (val, msg) {
50 | new Assertion(val, msg).to.exist;
51 | }
52 |
53 | // negation
54 | should.not = {}
55 |
56 | should.not.equal = function (val1, val2, msg) {
57 | new Assertion(val1, msg).to.not.equal(val2);
58 | };
59 |
60 | should.not.Throw = function (fn, errt, errs, msg) {
61 | new Assertion(fn, msg).to.not.Throw(errt, errs);
62 | };
63 |
64 | should.not.exist = function (val, msg) {
65 | new Assertion(val, msg).to.not.exist;
66 | }
67 |
68 | should['throw'] = should['Throw'];
69 | should.not['throw'] = should.not['Throw'];
70 |
71 | return should;
72 | };
73 |
74 | chai.should = loadShould;
75 | chai.Should = loadShould;
76 | };
77 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/node_modules/mkdirp/index.js:
--------------------------------------------------------------------------------
1 | var path = require('path');
2 | var fs = require('fs');
3 |
4 | module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP;
5 |
6 | function mkdirP (p, mode, f) {
7 | if (typeof mode === 'function' || mode === undefined) {
8 | f = mode;
9 | mode = 0777 & (~process.umask());
10 | }
11 |
12 | var cb = f || function () {};
13 | if (typeof mode === 'string') mode = parseInt(mode, 8);
14 | p = path.resolve(p);
15 |
16 | fs.mkdir(p, mode, function (er) {
17 | if (!er) return cb();
18 | switch (er.code) {
19 | case 'ENOENT':
20 | mkdirP(path.dirname(p), mode, function (er) {
21 | if (er) cb(er);
22 | else mkdirP(p, mode, cb);
23 | });
24 | break;
25 |
26 | case 'EEXIST':
27 | fs.stat(p, function (er2, stat) {
28 | // if the stat fails, then that's super weird.
29 | // let the original EEXIST be the failure reason.
30 | if (er2 || !stat.isDirectory()) cb(er)
31 | else cb();
32 | });
33 | break;
34 |
35 | default:
36 | cb(er);
37 | break;
38 | }
39 | });
40 | }
41 |
42 | mkdirP.sync = function sync (p, mode) {
43 | if (mode === undefined) {
44 | mode = 0777 & (~process.umask());
45 | }
46 |
47 | if (typeof mode === 'string') mode = parseInt(mode, 8);
48 | p = path.resolve(p);
49 |
50 | try {
51 | fs.mkdirSync(p, mode)
52 | }
53 | catch (err0) {
54 | switch (err0.code) {
55 | case 'ENOENT' :
56 | var err1 = sync(path.dirname(p), mode)
57 | if (err1) throw err1;
58 | else return sync(p, mode);
59 | break;
60 |
61 | case 'EEXIST' :
62 | var stat;
63 | try {
64 | stat = fs.statSync(p);
65 | }
66 | catch (err1) {
67 | throw err0
68 | }
69 | if (!stat.isDirectory()) throw err0;
70 | else return null;
71 | break;
72 | default :
73 | throw err0
74 | break;
75 | }
76 | }
77 |
78 | return null;
79 | };
80 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/diff/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Diff
6 |
7 |
8 |
9 |
10 |
11 |
Diff
12 |
13 |
14 |
15 |
16 |
17 | github.com/kpdecker/jsdiff
18 |
19 |
20 |
21 | | restaurant |
22 | aura |
23 | |
24 |
25 |
26 |
27 |
28 |
88 |
89 |
90 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/lib/filters.js:
--------------------------------------------------------------------------------
1 |
2 | /*!
3 | * Jade - filters
4 | * Copyright(c) 2010 TJ Holowaychuk
5 | * MIT Licensed
6 | */
7 |
8 | module.exports = {
9 |
10 | /**
11 | * Wrap text with CDATA block.
12 | */
13 |
14 | cdata: function(str){
15 | return '';
16 | },
17 |
18 | /**
19 | * Transform sass to css, wrapped in style tags.
20 | */
21 |
22 | sass: function(str){
23 | str = str.replace(/\\n/g, '\n');
24 | var sass = require('sass').render(str).replace(/\n/g, '\\n');
25 | return '';
26 | },
27 |
28 | /**
29 | * Transform stylus to css, wrapped in style tags.
30 | */
31 |
32 | stylus: function(str, options){
33 | var ret;
34 | str = str.replace(/\\n/g, '\n');
35 | var stylus = require('stylus');
36 | stylus(str, options).render(function(err, css){
37 | if (err) throw err;
38 | ret = css.replace(/\n/g, '\\n');
39 | });
40 | return '';
41 | },
42 |
43 | /**
44 | * Transform less to css, wrapped in style tags.
45 | */
46 |
47 | less: function(str){
48 | var ret;
49 | str = str.replace(/\\n/g, '\n');
50 | require('less').render(str, function(err, css){
51 | if (err) throw err;
52 | ret = '';
53 | });
54 | return ret;
55 | },
56 |
57 | /**
58 | * Transform markdown to html.
59 | */
60 |
61 | markdown: function(str){
62 | var md;
63 |
64 | // support markdown / discount
65 | try {
66 | md = require('markdown');
67 | } catch (err){
68 | try {
69 | md = require('discount');
70 | } catch (err) {
71 | try {
72 | md = require('markdown-js');
73 | } catch (err) {
74 | try {
75 | md = require('marked');
76 | } catch (err) {
77 | throw new
78 | Error('Cannot find markdown library, install markdown, discount, or marked.');
79 | }
80 | }
81 | }
82 | }
83 |
84 | str = str.replace(/\\n/g, '\n');
85 | return md.parse(str).replace(/\n/g, '\\n').replace(/'/g,''');
86 | },
87 |
88 | /**
89 | * Transform coffeescript to javascript.
90 | */
91 |
92 | coffeescript: function(str){
93 | str = str.replace(/\\n/g, '\n');
94 | var js = require('coffee-script').compile(str).replace(/\\/g, '\\\\').replace(/\n/g, '\\n');
95 | return '';
96 | }
97 | };
98 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/jade/lib/nodes/block.js:
--------------------------------------------------------------------------------
1 |
2 | /*!
3 | * Jade - nodes - Block
4 | * Copyright(c) 2010 TJ Holowaychuk
5 | * MIT Licensed
6 | */
7 |
8 | /**
9 | * Module dependencies.
10 | */
11 |
12 | var Node = require('./node');
13 |
14 | /**
15 | * Initialize a new `Block` with an optional `node`.
16 | *
17 | * @param {Node} node
18 | * @api public
19 | */
20 |
21 | var Block = module.exports = function Block(node){
22 | this.nodes = [];
23 | if (node) this.push(node);
24 | };
25 |
26 | /**
27 | * Inherit from `Node`.
28 | */
29 |
30 | Block.prototype.__proto__ = Node.prototype;
31 |
32 | /**
33 | * Block flag.
34 | */
35 |
36 | Block.prototype.isBlock = true;
37 |
38 | /**
39 | * Replace the nodes in `other` with the nodes
40 | * in `this` block.
41 | *
42 | * @param {Block} other
43 | * @api private
44 | */
45 |
46 | Block.prototype.replace = function(other){
47 | other.nodes = this.nodes;
48 | };
49 |
50 | /**
51 | * Pust the given `node`.
52 | *
53 | * @param {Node} node
54 | * @return {Number}
55 | * @api public
56 | */
57 |
58 | Block.prototype.push = function(node){
59 | return this.nodes.push(node);
60 | };
61 |
62 | /**
63 | * Check if this block is empty.
64 | *
65 | * @return {Boolean}
66 | * @api public
67 | */
68 |
69 | Block.prototype.isEmpty = function(){
70 | return 0 == this.nodes.length;
71 | };
72 |
73 | /**
74 | * Unshift the given `node`.
75 | *
76 | * @param {Node} node
77 | * @return {Number}
78 | * @api public
79 | */
80 |
81 | Block.prototype.unshift = function(node){
82 | return this.nodes.unshift(node);
83 | };
84 |
85 | /**
86 | * Return the "last" block, or the first `yield` node.
87 | *
88 | * @return {Block}
89 | * @api private
90 | */
91 |
92 | Block.prototype.includeBlock = function(){
93 | var ret = this
94 | , node;
95 |
96 | for (var i = 0, len = this.nodes.length; i < len; ++i) {
97 | node = this.nodes[i];
98 | if (node.yield) return node;
99 | else if (node.textOnly) continue;
100 | else if (node.includeBlock) ret = node.includeBlock();
101 | else if (node.block && !node.block.isEmpty()) ret = node.block.includeBlock();
102 | }
103 |
104 | return ret;
105 | };
106 |
107 | /**
108 | * Return a clone of this block.
109 | *
110 | * @return {Block}
111 | * @api private
112 | */
113 |
114 | Block.prototype.clone = function(){
115 | var clone = new Block;
116 | for (var i = 0, len = this.nodes.length; i < len; ++i) {
117 | clone.push(this.nodes[i].clone());
118 | }
119 | return clone;
120 | };
121 |
122 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/lib/browser/progress.js:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * Expose `Progress`.
4 | */
5 |
6 | module.exports = Progress;
7 |
8 | /**
9 | * Initialize a new `Progress` indicator.
10 | */
11 |
12 | function Progress() {
13 | this.percent = 0;
14 | this.size(0);
15 | this.fontSize(11);
16 | this.font('helvetica, arial, sans-serif');
17 | }
18 |
19 | /**
20 | * Set progress size to `n`.
21 | *
22 | * @param {Number} n
23 | * @return {Progress} for chaining
24 | * @api public
25 | */
26 |
27 | Progress.prototype.size = function(n){
28 | this._size = n;
29 | return this;
30 | };
31 |
32 | /**
33 | * Set text to `str`.
34 | *
35 | * @param {String} str
36 | * @return {Progress} for chaining
37 | * @api public
38 | */
39 |
40 | Progress.prototype.text = function(str){
41 | this._text = str;
42 | return this;
43 | };
44 |
45 | /**
46 | * Set font size to `n`.
47 | *
48 | * @param {Number} n
49 | * @return {Progress} for chaining
50 | * @api public
51 | */
52 |
53 | Progress.prototype.fontSize = function(n){
54 | this._fontSize = n;
55 | return this;
56 | };
57 |
58 | /**
59 | * Set font `family`.
60 | *
61 | * @param {String} family
62 | * @return {Progress} for chaining
63 | */
64 |
65 | Progress.prototype.font = function(family){
66 | this._font = family;
67 | return this;
68 | };
69 |
70 | /**
71 | * Update percentage to `n`.
72 | *
73 | * @param {Number} n
74 | * @return {Progress} for chaining
75 | */
76 |
77 | Progress.prototype.update = function(n){
78 | this.percent = n;
79 | return this;
80 | };
81 |
82 | /**
83 | * Draw on `ctx`.
84 | *
85 | * @param {CanvasRenderingContext2d} ctx
86 | * @return {Progress} for chaining
87 | */
88 |
89 | Progress.prototype.draw = function(ctx){
90 | var percent = Math.min(this.percent, 100)
91 | , size = this._size
92 | , half = size / 2
93 | , x = half
94 | , y = half
95 | , rad = half - 1
96 | , fontSize = this._fontSize;
97 |
98 | ctx.font = fontSize + 'px ' + this._font;
99 |
100 | var angle = Math.PI * 2 * (percent / 100);
101 | ctx.clearRect(0, 0, size, size);
102 |
103 | // outer circle
104 | ctx.strokeStyle = '#9f9f9f';
105 | ctx.beginPath();
106 | ctx.arc(x, y, rad, 0, angle, false);
107 | ctx.stroke();
108 |
109 | // inner circle
110 | ctx.strokeStyle = '#eee';
111 | ctx.beginPath();
112 | ctx.arc(x, y, rad - 1, 0, angle, true);
113 | ctx.stroke();
114 |
115 | // text
116 | var text = this._text || (percent | 0) + '%'
117 | , w = ctx.measureText(text).width;
118 |
119 | ctx.fillText(
120 | text
121 | , x - w / 2 + 1
122 | , y + fontSize / 2 - 1);
123 |
124 | return this;
125 | };
126 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/commander/History.md:
--------------------------------------------------------------------------------
1 |
2 | 0.6.1 / 2012-06-01
3 | ==================
4 |
5 | * Added: append (yes or no) on confirmation
6 | * Added: allow node.js v0.7.x
7 |
8 | 0.6.0 / 2012-04-10
9 | ==================
10 |
11 | * Added `.prompt(obj, callback)` support. Closes #49
12 | * Added default support to .choose(). Closes #41
13 | * Fixed the choice example
14 |
15 | 0.5.1 / 2011-12-20
16 | ==================
17 |
18 | * Fixed `password()` for recent nodes. Closes #36
19 |
20 | 0.5.0 / 2011-12-04
21 | ==================
22 |
23 | * Added sub-command option support [itay]
24 |
25 | 0.4.3 / 2011-12-04
26 | ==================
27 |
28 | * Fixed custom help ordering. Closes #32
29 |
30 | 0.4.2 / 2011-11-24
31 | ==================
32 |
33 | * Added travis support
34 | * Fixed: line-buffered input automatically trimmed. Closes #31
35 |
36 | 0.4.1 / 2011-11-18
37 | ==================
38 |
39 | * Removed listening for "close" on --help
40 |
41 | 0.4.0 / 2011-11-15
42 | ==================
43 |
44 | * Added support for `--`. Closes #24
45 |
46 | 0.3.3 / 2011-11-14
47 | ==================
48 |
49 | * Fixed: wait for close event when writing help info [Jerry Hamlet]
50 |
51 | 0.3.2 / 2011-11-01
52 | ==================
53 |
54 | * Fixed long flag definitions with values [felixge]
55 |
56 | 0.3.1 / 2011-10-31
57 | ==================
58 |
59 | * Changed `--version` short flag to `-V` from `-v`
60 | * Changed `.version()` so it's configurable [felixge]
61 |
62 | 0.3.0 / 2011-10-31
63 | ==================
64 |
65 | * Added support for long flags only. Closes #18
66 |
67 | 0.2.1 / 2011-10-24
68 | ==================
69 |
70 | * "node": ">= 0.4.x < 0.7.0". Closes #20
71 |
72 | 0.2.0 / 2011-09-26
73 | ==================
74 |
75 | * Allow for defaults that are not just boolean. Default peassignment only occurs for --no-*, optional, and required arguments. [Jim Isaacs]
76 |
77 | 0.1.0 / 2011-08-24
78 | ==================
79 |
80 | * Added support for custom `--help` output
81 |
82 | 0.0.5 / 2011-08-18
83 | ==================
84 |
85 | * Changed: when the user enters nothing prompt for password again
86 | * Fixed issue with passwords beginning with numbers [NuckChorris]
87 |
88 | 0.0.4 / 2011-08-15
89 | ==================
90 |
91 | * Fixed `Commander#args`
92 |
93 | 0.0.3 / 2011-08-15
94 | ==================
95 |
96 | * Added default option value support
97 |
98 | 0.0.2 / 2011-08-15
99 | ==================
100 |
101 | * Added mask support to `Command#password(str[, mask], fn)`
102 | * Added `Command#password(str, fn)`
103 |
104 | 0.0.1 / 2010-01-03
105 | ==================
106 |
107 | * Initial release
108 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/lib/reporters/xunit.js:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * Module dependencies.
4 | */
5 |
6 | var Base = require('./base')
7 | , utils = require('../utils')
8 | , escape = utils.escape;
9 |
10 | /**
11 | * Save timer references to avoid Sinon interfering (see GH-237).
12 | */
13 |
14 | var Date = global.Date
15 | , setTimeout = global.setTimeout
16 | , setInterval = global.setInterval
17 | , clearTimeout = global.clearTimeout
18 | , clearInterval = global.clearInterval;
19 |
20 | /**
21 | * Expose `XUnit`.
22 | */
23 |
24 | exports = module.exports = XUnit;
25 |
26 | /**
27 | * Initialize a new `XUnit` reporter.
28 | *
29 | * @param {Runner} runner
30 | * @api public
31 | */
32 |
33 | function XUnit(runner) {
34 | Base.call(this, runner);
35 | var stats = this.stats
36 | , tests = []
37 | , self = this;
38 |
39 | runner.on('pass', function(test){
40 | tests.push(test);
41 | });
42 |
43 | runner.on('fail', function(test){
44 | tests.push(test);
45 | });
46 |
47 | runner.on('end', function(){
48 | console.log(tag('testsuite', {
49 | name: 'Mocha Tests'
50 | , tests: stats.tests
51 | , failures: stats.failures
52 | , errors: stats.failures
53 | , skip: stats.tests - stats.failures - stats.passes
54 | , timestamp: (new Date).toUTCString()
55 | , time: stats.duration / 1000
56 | }, false));
57 |
58 | tests.forEach(test);
59 | console.log('');
60 | });
61 | }
62 |
63 | /**
64 | * Inherit from `Base.prototype`.
65 | */
66 |
67 | XUnit.prototype.__proto__ = Base.prototype;
68 |
69 | /**
70 | * Output tag for the given `test.`
71 | */
72 |
73 | function test(test) {
74 | var attrs = {
75 | classname: test.parent.fullTitle()
76 | , name: test.title
77 | , time: test.duration / 1000
78 | };
79 |
80 | if ('failed' == test.state) {
81 | var err = test.err;
82 | attrs.message = escape(err.message);
83 | console.log(tag('testcase', attrs, false, tag('failure', attrs, false, cdata(err.stack))));
84 | } else if (test.pending) {
85 | console.log(tag('testcase', attrs, false, tag('skipped', {}, true)));
86 | } else {
87 | console.log(tag('testcase', attrs, true) );
88 | }
89 | }
90 |
91 | /**
92 | * HTML tag helper.
93 | */
94 |
95 | function tag(name, attrs, close, content) {
96 | var end = close ? '/>' : '>'
97 | , pairs = []
98 | , tag;
99 |
100 | for (var key in attrs) {
101 | pairs.push(key + '="' + escape(attrs[key]) + '"');
102 | }
103 |
104 | tag = '<' + name + (pairs.length ? ' ' + pairs.join(' ') : '') + end;
105 | if (content) tag += content + '' + name + end;
106 | return tag;
107 | }
108 |
109 | /**
110 | * Return cdata escaped CDATA `str`.
111 | */
112 |
113 | function cdata(str) {
114 | return '';
115 | }
116 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/lib/interfaces/tdd.js:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * Module dependencies.
4 | */
5 |
6 | var Suite = require('../suite')
7 | , Test = require('../test');
8 |
9 | /**
10 | * TDD-style interface:
11 | *
12 | * suite('Array', function(){
13 | * suite('#indexOf()', function(){
14 | * suiteSetup(function(){
15 | *
16 | * });
17 | *
18 | * test('should return -1 when not present', function(){
19 | *
20 | * });
21 | *
22 | * test('should return the index when present', function(){
23 | *
24 | * });
25 | *
26 | * suiteTeardown(function(){
27 | *
28 | * });
29 | * });
30 | * });
31 | *
32 | */
33 |
34 | module.exports = function(suite){
35 | var suites = [suite];
36 |
37 | suite.on('pre-require', function(context, file, mocha){
38 |
39 | /**
40 | * Execute before each test case.
41 | */
42 |
43 | context.setup = function(fn){
44 | suites[0].beforeEach(fn);
45 | };
46 |
47 | /**
48 | * Execute after each test case.
49 | */
50 |
51 | context.teardown = function(fn){
52 | suites[0].afterEach(fn);
53 | };
54 |
55 | /**
56 | * Execute before the suite.
57 | */
58 |
59 | context.suiteSetup = function(fn){
60 | suites[0].beforeAll(fn);
61 | };
62 |
63 | /**
64 | * Execute after the suite.
65 | */
66 |
67 | context.suiteTeardown = function(fn){
68 | suites[0].afterAll(fn);
69 | };
70 |
71 | /**
72 | * Describe a "suite" with the given `title`
73 | * and callback `fn` containing nested suites
74 | * and/or tests.
75 | */
76 |
77 | context.suite = function(title, fn){
78 | var suite = Suite.create(suites[0], title);
79 | suites.unshift(suite);
80 | fn.call(suite);
81 | suites.shift();
82 | return suite;
83 | };
84 |
85 | /**
86 | * Exclusive test-case.
87 | */
88 |
89 | context.suite.only = function(title, fn){
90 | var suite = context.suite(title, fn);
91 | mocha.grep(suite.fullTitle());
92 | };
93 |
94 | /**
95 | * Describe a specification or test-case
96 | * with the given `title` and callback `fn`
97 | * acting as a thunk.
98 | */
99 |
100 | context.test = function(title, fn){
101 | var test = new Test(title, fn);
102 | suites[0].addTest(test);
103 | return test;
104 | };
105 |
106 | /**
107 | * Exclusive test-case.
108 | */
109 |
110 | context.test.only = function(title, fn){
111 | var test = context.test(title, fn);
112 | mocha.grep(test.fullTitle());
113 | };
114 |
115 | /**
116 | * Pending test case.
117 | */
118 |
119 | context.test.skip = function(title){
120 | context.test(title);
121 | };
122 | });
123 | };
124 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/debug/lib/debug.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Module dependencies.
3 | */
4 |
5 | var tty = require('tty');
6 |
7 | /**
8 | * Expose `debug()` as the module.
9 | */
10 |
11 | module.exports = debug;
12 |
13 | /**
14 | * Enabled debuggers.
15 | */
16 |
17 | var names = []
18 | , skips = [];
19 |
20 | (process.env.DEBUG || '')
21 | .split(/[\s,]+/)
22 | .forEach(function(name){
23 | name = name.replace('*', '.*?');
24 | if (name[0] === '-') {
25 | skips.push(new RegExp('^' + name.substr(1) + '$'));
26 | } else {
27 | names.push(new RegExp('^' + name + '$'));
28 | }
29 | });
30 |
31 | /**
32 | * Colors.
33 | */
34 |
35 | var colors = [6, 2, 3, 4, 5, 1];
36 |
37 | /**
38 | * Previous debug() call.
39 | */
40 |
41 | var prev = {};
42 |
43 | /**
44 | * Previously assigned color.
45 | */
46 |
47 | var prevColor = 0;
48 |
49 | /**
50 | * Is stdout a TTY? Colored output is disabled when `true`.
51 | */
52 |
53 | var isatty = tty.isatty(2);
54 |
55 | /**
56 | * Select a color.
57 | *
58 | * @return {Number}
59 | * @api private
60 | */
61 |
62 | function color() {
63 | return colors[prevColor++ % colors.length];
64 | }
65 |
66 | /**
67 | * Humanize the given `ms`.
68 | *
69 | * @param {Number} m
70 | * @return {String}
71 | * @api private
72 | */
73 |
74 | function humanize(ms) {
75 | var sec = 1000
76 | , min = 60 * 1000
77 | , hour = 60 * min;
78 |
79 | if (ms >= hour) return (ms / hour).toFixed(1) + 'h';
80 | if (ms >= min) return (ms / min).toFixed(1) + 'm';
81 | if (ms >= sec) return (ms / sec | 0) + 's';
82 | return ms + 'ms';
83 | }
84 |
85 | /**
86 | * Create a debugger with the given `name`.
87 | *
88 | * @param {String} name
89 | * @return {Type}
90 | * @api public
91 | */
92 |
93 | function debug(name) {
94 | function disabled(){}
95 | disabled.enabled = false;
96 |
97 | var match = skips.some(function(re){
98 | return re.test(name);
99 | });
100 |
101 | if (match) return disabled;
102 |
103 | match = names.some(function(re){
104 | return re.test(name);
105 | });
106 |
107 | if (!match) return disabled;
108 | var c = color();
109 |
110 | function colored(fmt) {
111 | var curr = new Date;
112 | var ms = curr - (prev[name] || curr);
113 | prev[name] = curr;
114 |
115 | fmt = ' \u001b[9' + c + 'm' + name + ' '
116 | + '\u001b[3' + c + 'm\u001b[90m'
117 | + fmt + '\u001b[3' + c + 'm'
118 | + ' +' + humanize(ms) + '\u001b[0m';
119 |
120 | console.error.apply(this, arguments);
121 | }
122 |
123 | function plain(fmt) {
124 | fmt = new Date().toUTCString()
125 | + ' ' + name + ' ' + fmt;
126 | console.error.apply(this, arguments);
127 | }
128 |
129 | colored.enabled = plain.enabled = true;
130 |
131 | return isatty || process.env.DEBUG_COLORS
132 | ? colored
133 | : plain;
134 | }
135 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/debug/debug.js:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * Expose `debug()` as the module.
4 | */
5 |
6 | module.exports = debug;
7 |
8 | /**
9 | * Create a debugger with the given `name`.
10 | *
11 | * @param {String} name
12 | * @return {Type}
13 | * @api public
14 | */
15 |
16 | function debug(name) {
17 | if (!debug.enabled(name)) return function(){};
18 |
19 | return function(fmt){
20 | var curr = new Date;
21 | var ms = curr - (debug[name] || curr);
22 | debug[name] = curr;
23 |
24 | fmt = name
25 | + ' '
26 | + fmt
27 | + ' +' + debug.humanize(ms);
28 |
29 | // This hackery is required for IE8
30 | // where `console.log` doesn't have 'apply'
31 | window.console
32 | && console.log
33 | && Function.prototype.apply.call(console.log, console, arguments);
34 | }
35 | }
36 |
37 | /**
38 | * The currently active debug mode names.
39 | */
40 |
41 | debug.names = [];
42 | debug.skips = [];
43 |
44 | /**
45 | * Enables a debug mode by name. This can include modes
46 | * separated by a colon and wildcards.
47 | *
48 | * @param {String} name
49 | * @api public
50 | */
51 |
52 | debug.enable = function(name) {
53 | try {
54 | localStorage.debug = name;
55 | } catch(e){}
56 |
57 | var split = (name || '').split(/[\s,]+/)
58 | , len = split.length;
59 |
60 | for (var i = 0; i < len; i++) {
61 | name = split[i].replace('*', '.*?');
62 | if (name[0] === '-') {
63 | debug.skips.push(new RegExp('^' + name.substr(1) + '$'));
64 | }
65 | else {
66 | debug.names.push(new RegExp('^' + name + '$'));
67 | }
68 | }
69 | };
70 |
71 | /**
72 | * Disable debug output.
73 | *
74 | * @api public
75 | */
76 |
77 | debug.disable = function(){
78 | debug.enable('');
79 | };
80 |
81 | /**
82 | * Humanize the given `ms`.
83 | *
84 | * @param {Number} m
85 | * @return {String}
86 | * @api private
87 | */
88 |
89 | debug.humanize = function(ms) {
90 | var sec = 1000
91 | , min = 60 * 1000
92 | , hour = 60 * min;
93 |
94 | if (ms >= hour) return (ms / hour).toFixed(1) + 'h';
95 | if (ms >= min) return (ms / min).toFixed(1) + 'm';
96 | if (ms >= sec) return (ms / sec | 0) + 's';
97 | return ms + 'ms';
98 | };
99 |
100 | /**
101 | * Returns true if the given mode name is enabled, false otherwise.
102 | *
103 | * @param {String} name
104 | * @return {Boolean}
105 | * @api public
106 | */
107 |
108 | debug.enabled = function(name) {
109 | for (var i = 0, len = debug.skips.length; i < len; i++) {
110 | if (debug.skips[i].test(name)) {
111 | return false;
112 | }
113 | }
114 | for (var i = 0, len = debug.names.length; i < len; i++) {
115 | if (debug.names[i].test(name)) {
116 | return true;
117 | }
118 | }
119 | return false;
120 | };
121 |
122 | // persist
123 |
124 | if (window.localStorage) debug.enable(localStorage.debug);
125 |
--------------------------------------------------------------------------------
/spec/node_modules/chai/README.md:
--------------------------------------------------------------------------------
1 | [](https://travis-ci.org/chaijs/chai)
2 |
3 | [](http://chaijs.com)
4 |
5 | Chai is a BDD / TDD assertion library for [node](http://nodejs.org) and the browser that
6 | can be delightfully paired with any javascript testing framework.
7 |
8 | For more information or to download plugins, view the [documentation](http://chaijs.com).
9 |
10 | ### Contributors
11 |
12 | project : chai
13 | repo age : 1 year, 2 months
14 | active : 117 days
15 | commits : 616
16 | files : 56
17 | authors :
18 | 459 Jake Luer 74.5%
19 | 66 Veselin Todorov 10.7%
20 | 42 Domenic Denicola 6.8%
21 | 5 Jo Liss 0.8%
22 | 5 Ruben Verborgh 0.8%
23 | 5 Scott Nonnenberg 0.8%
24 | 5 Juliusz Gonera 0.8%
25 | 4 josher19 0.6%
26 | 4 John Firebaugh 0.6%
27 | 3 Jeff Barczewski 0.5%
28 | 2 Edwin Shao 0.3%
29 | 2 Jakub Nešetřil 0.3%
30 | 2 Teddy Cross 0.3%
31 | 1 Anand Patil 0.2%
32 | 1 Kilian Ciuffolo 0.2%
33 | 1 Niklas Närhinen 0.2%
34 | 1 Paul Miller 0.2%
35 | 1 Chun-Yi 0.2%
36 | 1 Sasha Koss 0.2%
37 | 1 Chris Connelly 0.2%
38 | 1 Jeff Welch 0.2%
39 | 1 Benjamin Horsleben 0.2%
40 | 1 Victor Costan 0.2%
41 | 1 Vinay Pulim 0.2%
42 | 1 DD 0.2%
43 |
44 | ## License
45 |
46 | (The MIT License)
47 |
48 | Copyright (c) 2011-2012 Jake Luer
49 |
50 | Permission is hereby granted, free of charge, to any person obtaining a copy
51 | of this software and associated documentation files (the "Software"), to deal
52 | in the Software without restriction, including without limitation the rights
53 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
54 | copies of the Software, and to permit persons to whom the Software is
55 | furnished to do so, subject to the following conditions:
56 |
57 | The above copyright notice and this permission notice shall be included in
58 | all copies or substantial portions of the Software.
59 |
60 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
61 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
62 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
63 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
64 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
65 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
66 | THE SOFTWARE.
67 |
--------------------------------------------------------------------------------
/spec/node_modules/chai/lib/chai/utils/getPathValue.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * Chai - getPathValue utility
3 | * Copyright(c) 2012-2013 Jake Luer
4 | * @see https://github.com/logicalparadox/filtr
5 | * MIT Licensed
6 | */
7 |
8 | /**
9 | * ### .getPathValue(path, object)
10 | *
11 | * This allows the retrieval of values in an
12 | * object given a string path.
13 | *
14 | * var obj = {
15 | * prop1: {
16 | * arr: ['a', 'b', 'c']
17 | * , str: 'Hello'
18 | * }
19 | * , prop2: {
20 | * arr: [ { nested: 'Universe' } ]
21 | * , str: 'Hello again!'
22 | * }
23 | * }
24 | *
25 | * The following would be the results.
26 | *
27 | * getPathValue('prop1.str', obj); // Hello
28 | * getPathValue('prop1.att[2]', obj); // b
29 | * getPathValue('prop2.arr[0].nested', obj); // Universe
30 | *
31 | * @param {String} path
32 | * @param {Object} object
33 | * @returns {Object} value or `undefined`
34 | * @name getPathValue
35 | * @api public
36 | */
37 |
38 | var getPathValue = module.exports = function (path, obj) {
39 | var parsed = parsePath(path);
40 | return _getPathValue(parsed, obj);
41 | };
42 |
43 | /*!
44 | * ## parsePath(path)
45 | *
46 | * Helper function used to parse string object
47 | * paths. Use in conjunction with `_getPathValue`.
48 | *
49 | * var parsed = parsePath('myobject.property.subprop');
50 | *
51 | * ### Paths:
52 | *
53 | * * Can be as near infinitely deep and nested
54 | * * Arrays are also valid using the formal `myobject.document[3].property`.
55 | *
56 | * @param {String} path
57 | * @returns {Object} parsed
58 | * @api private
59 | */
60 |
61 | function parsePath (path) {
62 | var str = path.replace(/\[/g, '.[')
63 | , parts = str.match(/(\\\.|[^.]+?)+/g);
64 | return parts.map(function (value) {
65 | var re = /\[(\d+)\]$/
66 | , mArr = re.exec(value)
67 | if (mArr) return { i: parseFloat(mArr[1]) };
68 | else return { p: value };
69 | });
70 | };
71 |
72 | /*!
73 | * ## _getPathValue(parsed, obj)
74 | *
75 | * Helper companion function for `.parsePath` that returns
76 | * the value located at the parsed address.
77 | *
78 | * var value = getPathValue(parsed, obj);
79 | *
80 | * @param {Object} parsed definition from `parsePath`.
81 | * @param {Object} object to search against
82 | * @returns {Object|Undefined} value
83 | * @api private
84 | */
85 |
86 | function _getPathValue (parsed, obj) {
87 | var tmp = obj
88 | , res;
89 | for (var i = 0, l = parsed.length; i < l; i++) {
90 | var part = parsed[i];
91 | if (tmp) {
92 | if ('undefined' !== typeof part.p)
93 | tmp = tmp[part.p];
94 | else if ('undefined' !== typeof part.i)
95 | tmp = tmp[part.i];
96 | if (i == (l - 1)) res = tmp;
97 | } else {
98 | res = undefined;
99 | }
100 | }
101 | return res;
102 | };
103 |
--------------------------------------------------------------------------------
/spec/node_modules/chai/lib/chai/utils/addChainableMethod.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * Chai - addChainingMethod utility
3 | * Copyright(c) 2012-2013 Jake Luer
4 | * MIT Licensed
5 | */
6 |
7 | /*!
8 | * Module dependencies
9 | */
10 |
11 | var transferFlags = require('./transferFlags');
12 |
13 | /*!
14 | * Module variables
15 | */
16 |
17 | // Check whether `__proto__` is supported
18 | var hasProtoSupport = '__proto__' in Object;
19 |
20 | // Without `__proto__` support, this module will need to add properties to a function.
21 | // However, some Function.prototype methods cannot be overwritten,
22 | // and there seems no easy cross-platform way to detect them (@see chaijs/chai/issues/69).
23 | var excludeNames = /^(?:length|name|arguments|caller)$/;
24 |
25 | /**
26 | * ### addChainableMethod (ctx, name, method, chainingBehavior)
27 | *
28 | * Adds a method to an object, such that the method can also be chained.
29 | *
30 | * utils.addChainableMethod(chai.Assertion.prototype, 'foo', function (str) {
31 | * var obj = utils.flag(this, 'object');
32 | * new chai.Assertion(obj).to.be.equal(str);
33 | * });
34 | *
35 | * Can also be accessed directly from `chai.Assertion`.
36 | *
37 | * chai.Assertion.addChainableMethod('foo', fn, chainingBehavior);
38 | *
39 | * The result can then be used as both a method assertion, executing both `method` and
40 | * `chainingBehavior`, or as a language chain, which only executes `chainingBehavior`.
41 | *
42 | * expect(fooStr).to.be.foo('bar');
43 | * expect(fooStr).to.be.foo.equal('foo');
44 | *
45 | * @param {Object} ctx object to which the method is added
46 | * @param {String} name of method to add
47 | * @param {Function} method function to be used for `name`, when called
48 | * @param {Function} chainingBehavior function to be called every time the property is accessed
49 | * @name addChainableMethod
50 | * @api public
51 | */
52 |
53 | module.exports = function (ctx, name, method, chainingBehavior) {
54 | if (typeof chainingBehavior !== 'function')
55 | chainingBehavior = function () { };
56 |
57 | Object.defineProperty(ctx, name,
58 | { get: function () {
59 | chainingBehavior.call(this);
60 |
61 | var assert = function () {
62 | var result = method.apply(this, arguments);
63 | return result === undefined ? this : result;
64 | };
65 |
66 | // Use `__proto__` if available
67 | if (hasProtoSupport) {
68 | assert.__proto__ = this;
69 | }
70 | // Otherwise, redefine all properties (slow!)
71 | else {
72 | var asserterNames = Object.getOwnPropertyNames(ctx);
73 | asserterNames.forEach(function (asserterName) {
74 | if (!excludeNames.test(asserterName)) {
75 | var pd = Object.getOwnPropertyDescriptor(ctx, asserterName);
76 | Object.defineProperty(assert, asserterName, pd);
77 | }
78 | });
79 | }
80 |
81 | transferFlags(this, assert);
82 | return assert;
83 | }
84 | , configurable: true
85 | });
86 | };
87 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/node_modules/mkdirp/index.js:
--------------------------------------------------------------------------------
1 | var path = require('path');
2 | var fs = require('fs');
3 |
4 | module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP;
5 |
6 | function mkdirP (p, mode, f, made) {
7 | if (typeof mode === 'function' || mode === undefined) {
8 | f = mode;
9 | mode = 0777 & (~process.umask());
10 | }
11 | if (!made) made = null;
12 |
13 | var cb = f || function () {};
14 | if (typeof mode === 'string') mode = parseInt(mode, 8);
15 | p = path.resolve(p);
16 |
17 | fs.mkdir(p, mode, function (er) {
18 | if (!er) {
19 | made = made || p;
20 | return cb(null, made);
21 | }
22 | switch (er.code) {
23 | case 'ENOENT':
24 | mkdirP(path.dirname(p), mode, function (er, made) {
25 | if (er) cb(er, made);
26 | else mkdirP(p, mode, cb, made);
27 | });
28 | break;
29 |
30 | case 'EISDIR':
31 | case 'EPERM':
32 | // Operation not permitted or already is a dir.
33 | // This is the error you get when trying to mkdir('c:/')
34 | // on windows, or mkdir('/') on unix. Make sure it's a
35 | // dir by falling through to the EEXIST case.
36 | case 'EROFS':
37 | // a read-only file system.
38 | // However, the dir could already exist, in which case
39 | // the EROFS error will be obscuring a EEXIST!
40 | // Fallthrough to that case.
41 | case 'EEXIST':
42 | fs.stat(p, function (er2, stat) {
43 | // if the stat fails, then that's super weird.
44 | // let the original error be the failure reason.
45 | if (er2 || !stat.isDirectory()) cb(er, made)
46 | else cb(null, made);
47 | });
48 | break;
49 |
50 | default:
51 | cb(er, made);
52 | break;
53 | }
54 | });
55 | }
56 |
57 | mkdirP.sync = function sync (p, mode, made) {
58 | if (mode === undefined) {
59 | mode = 0777 & (~process.umask());
60 | }
61 | if (!made) made = null;
62 |
63 | if (typeof mode === 'string') mode = parseInt(mode, 8);
64 | p = path.resolve(p);
65 |
66 | try {
67 | fs.mkdirSync(p, mode);
68 | made = made || p;
69 | }
70 | catch (err0) {
71 | switch (err0.code) {
72 | case 'ENOENT' :
73 | made = sync(path.dirname(p), mode, made);
74 | sync(p, mode, made);
75 | break;
76 |
77 | case 'EEXIST' :
78 | var stat;
79 | try {
80 | stat = fs.statSync(p);
81 | }
82 | catch (err1) {
83 | throw err0;
84 | }
85 | if (!stat.isDirectory()) throw err0;
86 | break;
87 | default :
88 | throw err0
89 | break;
90 | }
91 | }
92 |
93 | return made;
94 | };
95 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/Makefile:
--------------------------------------------------------------------------------
1 |
2 | REPORTER ?= dot
3 | TM_DEST = ~/Library/Application\ Support/TextMate/Bundles
4 | TM_BUNDLE = JavaScript\ mocha.tmbundle
5 | SRC = $(shell find lib -name "*.js" -type f | sort)
6 | SUPPORT = $(wildcard support/*.js)
7 |
8 | all: mocha.js
9 |
10 | lib/browser/diff.js: node_modules/diff/diff.js
11 | cp node_modules/diff/diff.js lib/browser/diff.js
12 |
13 | mocha.js: $(SRC) $(SUPPORT) lib/browser/diff.js
14 | @node support/compile $(SRC)
15 | @cat \
16 | support/head.js \
17 | _mocha.js \
18 | support/tail.js \
19 | support/foot.js \
20 | > mocha.js
21 |
22 | clean:
23 | rm -f mocha.js
24 | rm -fr lib-cov
25 | rm -f coverage.html
26 |
27 | test-cov: lib-cov
28 | @COV=1 $(MAKE) test REPORTER=html-cov > coverage.html
29 |
30 | lib-cov:
31 | @rm -fr ./$@
32 | @jscoverage lib $@
33 |
34 | test: test-unit
35 |
36 | test-all: test-bdd test-tdd test-qunit test-exports test-unit test-grep test-jsapi test-compilers
37 |
38 | test-jsapi:
39 | @node test/jsapi
40 |
41 | test-unit:
42 | @./bin/mocha \
43 | --reporter $(REPORTER) \
44 | test/acceptance/*.js \
45 | test/*.js
46 |
47 | test-compilers:
48 | @./bin/mocha \
49 | --reporter $(REPORTER) \
50 | --compilers coffee:coffee-script,foo:./test/compiler/foo \
51 | test/acceptance/test.coffee \
52 | test/acceptance/test.foo
53 |
54 | test-bdd:
55 | @./bin/mocha \
56 | --reporter $(REPORTER) \
57 | --ui bdd \
58 | test/acceptance/interfaces/bdd
59 |
60 | test-tdd:
61 | @./bin/mocha \
62 | --reporter $(REPORTER) \
63 | --ui tdd \
64 | test/acceptance/interfaces/tdd
65 |
66 | test-qunit:
67 | @./bin/mocha \
68 | --reporter $(REPORTER) \
69 | --ui qunit \
70 | test/acceptance/interfaces/qunit
71 |
72 | test-exports:
73 | @./bin/mocha \
74 | --reporter $(REPORTER) \
75 | --ui exports \
76 | test/acceptance/interfaces/exports
77 |
78 | test-grep:
79 | @./bin/mocha \
80 | --reporter $(REPORTER) \
81 | --grep fast \
82 | test/acceptance/misc/grep
83 |
84 | test-invert:
85 | @./bin/mocha \
86 | --reporter $(REPORTER) \
87 | --grep slow \
88 | --invert \
89 | test/acceptance/misc/grep
90 |
91 | test-bail:
92 | @./bin/mocha \
93 | --reporter $(REPORTER) \
94 | --bail \
95 | test/acceptance/misc/bail
96 |
97 | test-async-only:
98 | @./bin/mocha \
99 | --reporter $(REPORTER) \
100 | --async-only \
101 | test/acceptance/misc/asyncOnly
102 |
103 | non-tty:
104 | @./bin/mocha \
105 | --reporter dot \
106 | test/acceptance/interfaces/bdd 2>&1 > /tmp/dot.out
107 |
108 | @echo dot:
109 | @cat /tmp/dot.out
110 |
111 | @./bin/mocha \
112 | --reporter list \
113 | test/acceptance/interfaces/bdd 2>&1 > /tmp/list.out
114 |
115 | @echo list:
116 | @cat /tmp/list.out
117 |
118 | @./bin/mocha \
119 | --reporter spec \
120 | test/acceptance/interfaces/bdd 2>&1 > /tmp/spec.out
121 |
122 | @echo spec:
123 | @cat /tmp/spec.out
124 |
125 | tm:
126 | mkdir -p $(TM_DEST)
127 | cp -fr editors/$(TM_BUNDLE) $(TM_DEST)
128 |
129 | .PHONY: test-cov test-jsapi test-compilers watch test test-all test-bdd test-tdd test-qunit test-exports test-unit non-tty test-grep tm clean
130 |
--------------------------------------------------------------------------------
/spec/node_modules/mocha/lib/interfaces/bdd.js:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * Module dependencies.
4 | */
5 |
6 | var Suite = require('../suite')
7 | , Test = require('../test');
8 |
9 | /**
10 | * BDD-style interface:
11 | *
12 | * describe('Array', function(){
13 | * describe('#indexOf()', function(){
14 | * it('should return -1 when not present', function(){
15 | *
16 | * });
17 | *
18 | * it('should return the index when present', function(){
19 | *
20 | * });
21 | * });
22 | * });
23 | *
24 | */
25 |
26 | module.exports = function(suite){
27 | var suites = [suite];
28 |
29 | suite.on('pre-require', function(context, file, mocha){
30 |
31 | /**
32 | * Execute before running tests.
33 | */
34 |
35 | context.before = function(fn){
36 | suites[0].beforeAll(fn);
37 | };
38 |
39 | /**
40 | * Execute after running tests.
41 | */
42 |
43 | context.after = function(fn){
44 | suites[0].afterAll(fn);
45 | };
46 |
47 | /**
48 | * Execute before each test case.
49 | */
50 |
51 | context.beforeEach = function(fn){
52 | suites[0].beforeEach(fn);
53 | };
54 |
55 | /**
56 | * Execute after each test case.
57 | */
58 |
59 | context.afterEach = function(fn){
60 | suites[0].afterEach(fn);
61 | };
62 |
63 | /**
64 | * Describe a "suite" with the given `title`
65 | * and callback `fn` containing nested suites
66 | * and/or tests.
67 | */
68 |
69 | context.describe = context.context = function(title, fn){
70 | var suite = Suite.create(suites[0], title);
71 | suites.unshift(suite);
72 | fn.call(suite);
73 | suites.shift();
74 | return suite;
75 | };
76 |
77 | /**
78 | * Pending describe.
79 | */
80 |
81 | context.xdescribe =
82 | context.xcontext =
83 | context.describe.skip = function(title, fn){
84 | var suite = Suite.create(suites[0], title);
85 | suite.pending = true;
86 | suites.unshift(suite);
87 | fn.call(suite);
88 | suites.shift();
89 | };
90 |
91 | /**
92 | * Exclusive suite.
93 | */
94 |
95 | context.describe.only = function(title, fn){
96 | var suite = context.describe(title, fn);
97 | mocha.grep(suite.fullTitle());
98 | };
99 |
100 | /**
101 | * Describe a specification or test-case
102 | * with the given `title` and callback `fn`
103 | * acting as a thunk.
104 | */
105 |
106 | context.it = context.specify = function(title, fn){
107 | var suite = suites[0];
108 | if (suite.pending) var fn = null;
109 | var test = new Test(title, fn);
110 | suite.addTest(test);
111 | return test;
112 | };
113 |
114 | /**
115 | * Exclusive test-case.
116 | */
117 |
118 | context.it.only = function(title, fn){
119 | var test = context.it(title, fn);
120 | mocha.grep(test.fullTitle());
121 | };
122 |
123 | /**
124 | * Pending test case.
125 | */
126 |
127 | context.xit =
128 | context.xspecify =
129 | context.it.skip = function(title){
130 | context.it(title);
131 | };
132 | });
133 | };
134 |
--------------------------------------------------------------------------------
/spec/notesSpec.js:
--------------------------------------------------------------------------------
1 | describe("Compile Notes", function() {
2 | var melody1_mus, melody2_mus, melody3_mus, melody1_note, melody2_notes,
3 | parallel_mus, parallel_note;
4 |
5 | beforeEach(function() {
6 | melody1_mus = { tag: 'note', pitch: 'a4', dur: 125 };
7 | melody1_note = [ { tag: 'note', pitch: 'a4', start: 0, dur: 125 } ];
8 | melody2_mus =
9 | { tag: 'seq',
10 | left:
11 | { tag: 'seq',
12 | left: { tag: 'note', pitch: 'a4', dur: 250 },
13 | right: { tag: 'note', pitch: 'b4', dur: 250 } },
14 | right:
15 | { tag: 'seq',
16 | left: { tag: 'note', pitch: 'c4', dur: 500 },
17 | right: { tag: 'note', pitch: 'd4', dur: 500 } } };
18 |
19 | melody3_mus =
20 | { tag: 'seq',
21 | left:
22 | { tag: 'seq',
23 | left: { tag: 'note', pitch: 'd4', dur: 500 },
24 | right: { tag: 'note', pitch: 'c4', dur: 500 } },
25 | right:
26 | { tag: 'seq',
27 | left: { tag: 'note', pitch: 'b4', dur: 250 },
28 | right: { tag: 'note', pitch: 'a4', dur: 250 } } };
29 |
30 | melody2_notes = [
31 | { tag: 'note', pitch: 'a4', start: 0, dur: 250 },
32 | { tag: 'note', pitch: 'b4', start: 250, dur: 250 },
33 | { tag: 'note', pitch: 'c4', start: 500, dur: 500 },
34 | { tag: 'note', pitch: 'd4', start: 1000, dur: 500 } ];
35 |
36 | parallel_mus =
37 | { tag: 'seq',
38 | left:
39 | { tag: 'par',
40 | left: { tag: 'note', pitch: 'c3', dur: 250 },
41 | right: { tag: 'note', pitch: 'g4', dur: 500 } },
42 | right:
43 | { tag: 'par',
44 | left: { tag: 'note', pitch: 'd3', dur: 500 },
45 | right: { tag: 'note', pitch: 'f4', dur: 250 } } };
46 |
47 | parallel_notes = [
48 | { tag: 'note', pitch: 'c3', start: 0, dur: 250 },
49 | { tag: 'note', pitch: 'g4', start: 0, dur: 500 },
50 | { tag: 'note', pitch: 'd3', start: 500, dur: 500 },
51 | { tag: 'note', pitch: 'f4', start: 500, dur: 250 } ];
52 |
53 | rest = { tag: 'rest', dur: 250};
54 | repeated_note = { tag: 'repeat', section: melody1_note[0], count: 3 };
55 | });
56 |
57 | describe("reverse sytax tree", function() {
58 | it("A single note should return itself", function() {
59 | expect(reverse(melody1_mus)).toEqual(melody1_mus);
60 | });
61 |
62 | it("A nested musical expression with multiple notes should reverse itself", function() {
63 | expect(reverse(melody2_mus)).toEqual(melody3_mus);
64 | });
65 | });
66 |
67 | describe("Musical expression compiler", function() {
68 | it("A sequence with a single note should return and array with the note", function() {
69 |
70 | expect(compile(melody1_mus)).toEqual(melody1_note);
71 | });
72 |
73 | it("A complex musical expression should compile to notes", function() {
74 | expect(compile(melody2_mus)).toEqual(melody2_notes);
75 | });
76 |
77 | it("A sequence with parallel notes and sequences should compile correctly", function() {
78 | expect(compile(parallel_mus)).toEqual(parallel_notes);
79 | });
80 |
81 | it("A sequence with a rest should compile to a rest", function() {
82 | expect(compile(rest)).toEqual([rest]);
83 | });
84 |
85 | it("A sequence with a 'repeat' should compile to multiple copies of that note", function() {
86 | var note = repeated_note.section; // repeated note defined with count=3
87 | expect(compile(repeated_note)).toEqual([note, note, note]);
88 | });
89 | });
90 | });
--------------------------------------------------------------------------------