Skip to content

Commit

Permalink
Changed tests to be quicker
Browse files Browse the repository at this point in the history
  • Loading branch information
doug-martin committed Feb 28, 2013
1 parent b3a015a commit 149d2d0
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 47 deletions.
13 changes: 12 additions & 1 deletion nools.js
Expand Up @@ -398,7 +398,18 @@ require.define("/package.json",function(require,module,exports,__dirname,__filen
require.define("/index.js",function(require,module,exports,__dirname,__filename,process,global){module.exports = exports = require("./lib");
});

require.define("/lib/index.js",function(require,module,exports,__dirname,__filename,process,global){"use strict";
require.define("/lib/index.js",function(require,module,exports,__dirname,__filename,process,global){/**
*
* @projectName nools
* @github https://github.com/C2FO/nools
* @includeDoc [Change Log] ../History.md
* @header [../readme.md]
*/




"use strict";
var extd = require("./extended"),
fs = require("fs"),
path = require("path"),
Expand Down
2 changes: 1 addition & 1 deletion nools.min.js

Large diffs are not rendered by default.

32 changes: 17 additions & 15 deletions test/flow.compiled.test.js
Expand Up @@ -150,22 +150,24 @@ it.describe("Flow compiled",function (it) {
Result = flow.getDefined("result");
});

it.should("calculate Fibonacci of 10", function () {
it.should("calculate fibonacci numbers", function () {
var result = new Result();
var session = flow.getSession(new Fibonacci(10), result);
return session.match().then(function () {
session.dispose();
assert.equal(result.value, 55);
});
});

it.should("calculate Fibonacci of 150", function () {
var result = new Result();
var session = flow.getSession(new Fibonacci(150), result);
return session.match().then(function () {
session.dispose();
assert.equal(result.value, 9.969216677189305e+30);
});
return flow.getSession(new Fibonacci(3), result).match()
.then(function () {
assert.equal(result.value, 2);
return flow.getSession(new Fibonacci(4), result).match();
})
.then(function () {
assert.equal(result.value, 3);
return flow.getSession(new Fibonacci(5), result).match();
})
.then(function () {
assert.equal(result.value, 5);
return flow.getSession(new Fibonacci(6), result).match();
})
.then(function () {
assert.equal(result.value, 8);
});
});

});
Expand Down
32 changes: 17 additions & 15 deletions test/flow.dsl.test.js
Expand Up @@ -143,22 +143,24 @@ it.describe("Flow dsl",function (it) {
var Fibonacci = flow.getDefined("fibonacci");
var Result = flow.getDefined("result");

it.should("calculate Fibonacci of 10", function () {
it.should("calculate fibonacci numbers", function () {
var result = new Result();
var session = flow.getSession(new Fibonacci(10), result);
return session.match().then(function () {
session.dispose();
assert.equal(result.value, 55);
});
});

it.should("calculate Fibonacci of 150", function () {
var result = new Result();
var session = flow.getSession(new Fibonacci(150), result);
return session.match().then(function () {
session.dispose();
assert.equal(result.value, 9.969216677189305e+30);
});
return flow.getSession(new Fibonacci(3), result).match()
.then(function () {
assert.equal(result.value, 2);
return flow.getSession(new Fibonacci(4), result).match();
})
.then(function () {
assert.equal(result.value, 3);
return flow.getSession(new Fibonacci(5), result).match();
})
.then(function () {
assert.equal(result.value, 5);
return flow.getSession(new Fibonacci(6), result).match();
})
.then(function () {
assert.equal(result.value, 8);
});
});

});
Expand Down
33 changes: 18 additions & 15 deletions test/flow.test.js
@@ -1,6 +1,7 @@
"use strict";
var it = require("it"),
declare = require("declare.js"),
when = require("promise-extended").when,
assert = require("assert"),
nools = require("../index");

Expand Down Expand Up @@ -424,22 +425,24 @@ it.describe("Flow",function (it) {
});


it.should("calculate Fibonacci of 10", function () {
var session = flow.getSession(new Fibonacci(10));
return session.match().then(function () {
session.dispose();
assert.equal(result, 55);
});
});

it.should("calculate Fibonacci of 150", function () {
var session = flow.getSession(new Fibonacci(150));
return session.match().then(function () {
session.dispose();
assert.equal(result, 9.969216677189305e+30);
});
it.should("calculate fibonacci numbers", function () {
return flow.getSession(new Fibonacci(3)).match()
.then(function () {
assert.equal(result, 2);
return flow.getSession(new Fibonacci(4)).match();
})
.then(function () {
assert.equal(result, 3);
return flow.getSession(new Fibonacci(5)).match()
})
.then(function () {
assert.equal(result, 5);
return flow.getSession(new Fibonacci(6)).match();
})
.then(function () {
assert.equal(result, 8);
});
});

});


Expand Down

0 comments on commit 149d2d0

Please sign in to comment.