Permalink
Browse files

changed chmod and added example test

  • Loading branch information...
1 parent f6ba50d commit 28ae61e3e807bfa5f0d633763f41b5c06be125c7 zyndiecate committed Dec 3, 2011
Showing with 60 additions and 0 deletions.
  1. 0 bin/broke
  2. +60 −0 examples/example_test.js
View
0 bin/broke 100755 → 100644
No changes.
View
@@ -0,0 +1,60 @@
+
+
+var broke = require('broke')
+ , assert = require('assert');
+
+broke
+ .test('dummy test suite')
+
+ .start({
+ 'init the test suite': {
+ process: {
+ method: function() {
+ this.callback(undefined, 'data');
+ }
+ },
+ assert: {
+ 'test suite initialized': function(err, data) {
+ assert.isNull(err);
+ assert.equal(data, 'data');
+ }
+ }
+ }
+ })
+
+ .batch({
+ 'test your code': {
+ config: {
+ repeats: 5,
+ delay: 500,
+ calmDown: 500,
+ timeout: 2000
+ },
+ process: {
+ request: {method: 'GET', url: 'http://google.com', options: {port: 80}}
+ },
+ assert: {
+ statusCode: 301
+ }
+ }
+ })
+
+ .stop({
+ 'tear down the test suite': {
+ process: {
+ method: function() {
+ this.callback(undefined, 'data');
+ }
+ },
+ assert: {
+ 'test suite back to normal': function(err, data) {
+ assert.isNull(err);
+ assert.equal(data, 'data');
+ }
+ }
+ }
+ })
+
+.run(module, require('./custom_assertions.js'));
+
+

0 comments on commit 28ae61e

Please sign in to comment.