Permalink
Browse files

[test] More tests for custom plugins

  • Loading branch information...
1 parent 89fd7e1 commit 8cae7b59455d359be2e5df296b94a7cf95e6a434 @indexzero indexzero committed Aug 3, 2011
Showing with 13 additions and 2 deletions.
  1. +13 −2 test/simple/use-custom-plugin-test.js
@@ -16,8 +16,19 @@ var PORT = 5050;
vows.describe('carapace/simple/use-custom-plugin').addBatch({
"When using haibu-carapace": helper.assertListen(PORT, {
"a custom plugin" : {
- "with an absolute path": helper.assertUse([path.join(__dirname, '..', 'fixtures', 'custom.js')]),
- //"with a relative path": helper.assertUse('../fixtures/relative.js')
+ "with an absolute path": helper.assertUse([path.join(__dirname, '..', 'fixtures', 'custom.js')], {
+ "after the plugin is loaded": {
+ topic: function () {
+ carapace.on('carapace::custom', this.callback.bind(carapace, null));
+ },
+ "should emit the `carapace::custom` event": function (_, info) {
+ assert.isTrue(info.custom);
+ }
+ }
+ }),
+ "with a relative path": function () {
+ assert.throws(function () { carapace.load('../fixtures/relative.js') });
+ }
}
})
}).export(module);

0 comments on commit 8cae7b5

Please sign in to comment.