mirror of
https://github.com/Hopiu/postal.js.git
synced 2026-03-17 06:30:23 +00:00
20 lines
No EOL
902 B
JavaScript
20 lines
No EOL
902 B
JavaScript
QUnit.specify("postal.js", function(){
|
|
describe("ChannelDefinition", function(){
|
|
describe("When initializing a channel definition", function() {
|
|
var chDef = new ChannelDefinition("TestExchange", "TestTopic");
|
|
it("should set exchange to TestExchange", function(){
|
|
assert(chDef.exchange).equals("TestExchange");
|
|
});
|
|
it("should set topic to TestTopic", function(){
|
|
assert(chDef.topic).equals("TestTopic");
|
|
});
|
|
});
|
|
describe("When calling subscribe", function() {
|
|
var ch = new ChannelDefinition("TestExchange", "TestTopic"),
|
|
sub = ch.subscribe(function(){ });
|
|
it("subscription should be instance of SubscriptionDefinition", function(){
|
|
assert(sub instanceof SubscriptionDefinition).isTrue();
|
|
});
|
|
});
|
|
});
|
|
}); |