summaryrefslogtreecommitdiffstats
path: root/test/plugins.js
diff options
context:
space:
mode:
authorSamy Pesse <samypesse@gmail.com>2016-02-16 18:46:16 +0100
committerSamy Pesse <samypesse@gmail.com>2016-02-16 18:46:16 +0100
commitca85c0ecf35eb2265b35ae480fbe34b12cf4bafe (patch)
tree06ca414fd4d54a3c8f8b2266d72cb91525d17c3c /test/plugins.js
parent702db46f20d2b613540901311708cf4e49d95690 (diff)
downloadgitbook-ca85c0ecf35eb2265b35ae480fbe34b12cf4bafe.zip
gitbook-ca85c0ecf35eb2265b35ae480fbe34b12cf4bafe.tar.gz
gitbook-ca85c0ecf35eb2265b35ae480fbe34b12cf4bafe.tar.bz2
Add method to install plugin from npm
Add tests for it
Diffstat (limited to 'test/plugins.js')
-rw-r--r--test/plugins.js37
1 files changed, 37 insertions, 0 deletions
diff --git a/test/plugins.js b/test/plugins.js
new file mode 100644
index 0000000..123a194
--- /dev/null
+++ b/test/plugins.js
@@ -0,0 +1,37 @@
+var mock = require('./mock');
+var registry = require('../lib/plugins/registry');
+
+describe('Plugins', function() {
+ var book;
+
+ before(function() {
+ return mock.setupBook({})
+ .then(function(_book) {
+ book = _book;
+ });
+ });
+
+ describe('Resolve Version', function() {
+
+ it('should resolve a plugin version', function() {
+ return registry.resolve('ga')
+ .should.be.fulfilled();
+ });
+
+ });
+
+ describe('Installation', function() {
+
+ it('should install a plugin from NPM without a specific version', function() {
+ return registry.install(book, 'ga')
+ .should.be.fulfilled();
+ });
+
+ it('should install a plugin from NPM with a specific version', function() {
+ return registry.install(book, 'ga', '1.0.0')
+ .should.be.fulfilled();
+ });
+
+ });
+});
+