diff options
author | Samy Pessé <samypesse@gmail.com> | 2015-03-09 10:43:12 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2015-03-09 10:43:12 +0100 |
commit | 34fc2831e0cf0fed01c71cec28d93472d87f455b (patch) | |
tree | a803cc907c20491ba02863b5d3dd5aedf6bfed10 /test/plugin.js | |
parent | e1594cde2c32e4ff48f6c4eff3d3d461743d74e1 (diff) | |
parent | 1bf68a5aa0703b5a1815cfe4ebb731b5fb6ed9d2 (diff) | |
download | gitbook-34fc2831e0cf0fed01c71cec28d93472d87f455b.zip gitbook-34fc2831e0cf0fed01c71cec28d93472d87f455b.tar.gz gitbook-34fc2831e0cf0fed01c71cec28d93472d87f455b.tar.bz2 |
Merge branch 'version/2.0'
Diffstat (limited to 'test/plugin.js')
-rw-r--r-- | test/plugin.js | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/test/plugin.js b/test/plugin.js deleted file mode 100644 index fcde67c..0000000 --- a/test/plugin.js +++ /dev/null @@ -1,58 +0,0 @@ -var _ = require('lodash'); -var path = require('path'); -var assert = require('assert'); - -var Plugin = require('../').generate.Plugin; - -describe('Plugin validation', function () { - var plugin = new Plugin("plugin", __dirname); - - it('should be valid', function() { - assert(plugin.isValid()); - }); -}); - -describe('Plugins list', function () { - var firstDefault = _.first(Plugin.defaults); - - it('should convert string to array', function() { - var _name = "test"; - assert(_.contains(Plugin.normalizeNames(_name), _name)); - }); - - it('should contains default plugins', function() { - assert(_.contains(Plugin.normalizeNames([]), firstDefault)); - }); - - it('should remove name starting with -', function() { - assert(!_.contains(Plugin.normalizeNames(["-"+firstDefault]), firstDefault)); - }); - - it('should accept version', function() { - var _name = "test@0.3.0,exercises@1.2.0,test2"; - var plugins = Plugin.normalizeList(_name); - - assert(_.find(plugins, {'name': "test"}).version = "0.3.0"); - assert(_.find(plugins, {'name': "exercises"}).version = "1.2.0"); - assert(!_.find(plugins, {'name': "test2"}).version); - }); -}); - -describe('Plugin defaults loading', function () { - var ret = true; - - beforeEach(function(done){ - Plugin.fromList(Plugin.defaults, __dirname) - .then(function(_r) { - ret = _r; - }, function(err) { - ret = null; - }) - .fin(done); - }); - - - it('should load defaults addons', function() { - assert(ret != null); - }); -}); |