forked from aaronpowell/Postman
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7069a3b
commit d032afa
Showing
3 changed files
with
30 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
test('messages can be delivered with no receiver', function() { | ||
postman.deliver('test1'); | ||
ok(true); | ||
}); | ||
|
||
test('receiver can be added without delivery', function() { | ||
postman.receive('test2'); | ||
ok(true); | ||
}); | ||
|
||
test('receive before deliver sends message', function() { | ||
postman.receive('test3', function() { ok(true); }); | ||
postman.deliver('test3'); | ||
}); | ||
|
||
test('receive after deliver sends message', function() { | ||
postman.deliver('test4'); | ||
postman.receive('test4', function() { ok(true); }); | ||
}); | ||
|
||
test('deliver a message with data and it\'s received', function() { | ||
postman.receive('test5', function(x) { ok(x === 'win'); }); | ||
postman.deliver('test5', 'win'); | ||
}); | ||
|
||
test('deliver complex message and ye shall receive', function() { | ||
postman.receive('test6', function(x) { ok(x.foo === 'bar'); }); | ||
postman.deliver('test6', { foo: 'bar' }); | ||
}); |