Permalink
Browse files

Export Gently class directly

  • Loading branch information...
1 parent da84ab0 commit 9ffd691214c47144a3630e016bc0ba387aa37b7c @felixge committed Jun 13, 2010
Showing with 8 additions and 8 deletions.
  1. +4 −4 Readme.md
  2. +1 −1 example/dog.js
  3. +1 −1 example/event_emitter.js
  4. +1 −1 lib/gently/gently.js
  5. +1 −1 test/simple/test-gently.js
View
@@ -32,7 +32,7 @@ Make sure your dog is working properly:
require('sys').puts(bark);
}
- var gently = new (require('gently').Gently)
+ var gently = new (require('gently'))
, assert = require('assert')
, dog = new Dog();
@@ -45,7 +45,7 @@ Make sure your dog is working properly:
You can also easily test event emitters with this, for example a simple sequence of 2 events emitted by `fs.WriteStream`:
- var gently = new (require('gently').Gently)
+ var gently = new (require('gently'))
, stream = new (require('fs').WriteStream)('my_file.txt');
gently.expect(stream, 'emit', function(event) {
@@ -60,9 +60,9 @@ For a full read world example, check out this test case: [test-incoming-form.js]
## API
-### gently.Gently
+### Gently
-#### new gently.Gently()
+#### new Gently()
Creates a new gently instance. It listens to the process `'exit'` event to make sure all expectations have been verified.
View
@@ -10,7 +10,7 @@ Dog.prototype.bark = function(bark) {
require('sys').puts(bark);
}
-var gently = new (require('gently').Gently)
+var gently = new (require('gently'))
, assert = require('assert')
, dog = new Dog();
View
@@ -1,5 +1,5 @@
require('../test/common');
-var gently = new (require('gently').Gently)
+var gently = new (require('gently'))
, stream = new (require('fs').WriteStream)('my_file.txt');
gently.expect(stream, 'emit', function(event) {
View
@@ -6,7 +6,7 @@ function Gently() {
self.verify('process exit');
});
};
-exports.Gently = Gently;
+module.exports = Gently;
Gently.prototype.expect = function(obj, method, count, mock) {
if (typeof obj != 'function' && typeof obj != 'object') {
@@ -1,5 +1,5 @@
require('../common');
-var Gently = require('gently').Gently
+var Gently = require('gently')
, gently;
function test(test) {

0 comments on commit 9ffd691

Please sign in to comment.