Permalink
Browse files

removed concept of setup in favor of simplicity

  • Loading branch information...
1 parent 4352a92 commit c3310ad4df8ef2209923771c7e6228ad35fb0333 @brianc committed Dec 23, 2010
Showing with 1 addition and 61 deletions.
  1. +1 −9 lib/index.js
  2. +0 −52 test/initial-tests.js
View
@@ -30,15 +30,7 @@ var executeAction = function(action, callback) {
}
}
}
- //optional setup parameter
- if(action.setup) {
- action.setup(function(result) {
- doAction(action, result)
- })
- } else {
- doAction(action)
- }
-
+ doAction(action)
}
var bench = function(config) {
View
@@ -85,55 +85,3 @@ test('multiple actions', function() {
})
})
-
-test('action setup', function() {
- var boom = 0;
- var bm = bench({
- repeat: 10,
- actions:[{
- name: 'boom',
- setup: should.call(function(next) {
- next(++boom)
- }),
- run: function(context, next) {
- context.should.equal(1)
- next()
- },
- teardown: should.call(function(context, next) {
- context.should.equal(1)
- next()
- })
- }]
- })
- bm(should.call(function() {
- test('executes', function() {
- boom.should.equal(1)
- })
- }))
-})
-
-test('context setup', function() {
- var boom = 0;
- var bm = bench({
- name: 'whatever',
- repeat: 1,
- setup: should.call(function(next) {
- next(boom++)
- }),
- actions: [{
- name: 'single action with no setup',
- run: should.call(function(context, next) {
- context.should.equal(1)
- next()
- })
- }],
- teardown: should.call(function(context, next) {
- context.should.equal(1)
- next()
- })
- })
- bm(should.call(function() {
- boom.should.equal(1)
- }))
-})
-

0 comments on commit c3310ad

Please sign in to comment.