diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-02-22 15:34:35 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-02-22 15:34:35 +0100 |
commit | 6653307fda137253cd10d4d4f6d2e010c1c0f604 (patch) | |
tree | 754d73e1dadc19e692bfce468e674cd66eff8a0a /test/plugins.js | |
parent | 642ba72a1d0680107357083a79560c2ccc931457 (diff) | |
download | gitbook-6653307fda137253cd10d4d4f6d2e010c1c0f604.zip gitbook-6653307fda137253cd10d4d4f6d2e010c1c0f604.tar.gz gitbook-6653307fda137253cd10d4d4f6d2e010c1c0f604.tar.bz2 |
Add tests for context of filters
Diffstat (limited to 'test/plugins.js')
-rw-r--r-- | test/plugins.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/plugins.js b/test/plugins.js index 576c96b..03bbc26 100644 --- a/test/plugins.js +++ b/test/plugins.js @@ -1,3 +1,4 @@ +var _ = require('lodash'); var path = require('path'); var mock = require('./mock'); @@ -124,5 +125,31 @@ describe('Plugins', function() { }); }); }); + + describe('Filters', function() { + var plugin, filters; + + before(function() { + plugin = new BookPlugin(book, 'test-filters'); + return plugin.load(PLUGINS_ROOT) + + .then(function() { + filters = plugin.getFilters(); + }); + }); + + + it('should list all resources for website', function() { + _.size(filters).should.equal(2); + }); + + it('should correctly execute a filter', function() { + filters.hello('World').should.equal('Hello World!'); + }); + + it('should correctly set contexts for filter', function() { + filters.testContext('Hello'); + }); + }); }); |