Skip to content

Commit

Permalink
spec update
Browse files Browse the repository at this point in the history
  • Loading branch information
David committed Jul 1, 2011
1 parent cfb8d1a commit c474d3e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions spec/CommandSpec.js
Expand Up @@ -9,13 +9,15 @@ describe("Command", function() {
it("should call a handler when executed", function() {
command.setHandler(handler);
command.execute();

expect(handler).toHaveBeenCalled();
});

it("should notify when a handler was registered", function() {
var callback = jasmine.createSpy();
command.subscribe(mindmaps.Command.Event.HANDLER_REGISTERED, callback);
command.setHandler(handler);

expect(callback).toHaveBeenCalled();

});
Expand All @@ -25,6 +27,7 @@ describe("Command", function() {
command.setHandler(handler);
command.subscribe(mindmaps.Command.Event.HANDLER_REMOVED, callback);
command.removeHandler();

expect(callback).toHaveBeenCalled();
});

Expand Down Expand Up @@ -53,6 +56,7 @@ describe("CommandRegistry", function() {

it("should a return a command object for a command type", function() {
var command = registry.get(type);

expect(command).toBeDefined();
expect(command instanceof type).toBeTruthy();
});
Expand Down

0 comments on commit c474d3e

Please sign in to comment.