Skip to content
Browse files

Simplify setup() and teardown()

  • Loading branch information...
1 parent b10f99d commit 711dd712b1977243b3e1fa5f5ed19bb3257f6952 @5long committed Jul 23, 2011
Showing with 5 additions and 10 deletions.
  1. +2 −4 doc/api.mkd
  2. +3 −6 example/all_in_one.js
View
6 doc/api.mkd
@@ -85,9 +85,8 @@ Example:
var reut = require("reut")
, fs = require("fs")
reut.suite("Multiple setup supported")
- .setup(function(fixture, done) {
+ .setup(function(fixture) {
fixture.message = "Take this."
- done()
})
.setup(function(fixture, done) {
fs.stat("/", function(err, stat){
@@ -120,9 +119,8 @@ Example:
.test("A simple test", function(test, fixture) {
test.deepEqual(fixture, {foo: "bar"})
})
- .setup(function(fixture, done){
+ .setup(function(fixture){
fixture.foo = "bar"
- done()
})
## Controlling Interface of Test
View
9 example/all_in_one.js
@@ -5,13 +5,11 @@ var reut = require("reut")
if (module == require.main) process.nextTick(reut.run)
reut.suite("A suite to contain 'em all")
-.setup(function(fixture, done) {
+.setup(function(fixture) {
fixture.answer = 42
- done()
})
-.teardown(function(fixture, done) {
+.teardown(function(fixture) {
delete fixture.answer
- done()
})
.test("Native assert methods", function(test, fixture) {
test.ok(!test.fail, "Not provided")
@@ -49,9 +47,8 @@ reut.suite("A suite to contain 'em all")
done()
})
})
-.teardown(function(fixture, done) {
+.teardown(function(fixture) {
delete fixture.stat
- done()
})
.test("Something async", function(test, fixture) {
var boy = new EE()

0 comments on commit 711dd71

Please sign in to comment.
Something went wrong with that request. Please try again.