From fc94057e467daeb78d624d5ca43aa47513f2091c Mon Sep 17 00:00:00 2001 From: Pedro Dias Date: Tue, 24 Feb 2015 10:01:34 +0000 Subject: [PATCH] minor tests fixes, v1.0.4 --- .gitignore | 1 - package.json | 8 +++++--- test/host.js | 5 +++-- test/spec_helper.js | 4 +++- test/template.js | 7 ++++--- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index e212594..3c3629e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ - node_modules diff --git a/package.json b/package.json index 8287126..a5c979a 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,10 @@ "name": "opennebula", "description": "OpenNebula XML-RPC API client.", "version": "1.0.4", + "author": "Pedro Dias ", + "maintainers": [ + "apocas " + ], "repository": { "type": "git", "url": "https://github.com/apocas/node-one.git" @@ -9,9 +13,6 @@ "bugs": { "url": "https://github.com/apocas/node-one/issues" }, - "directories": { - "lib": "./lib" - }, "dependencies": { "xml2js": "0.4.4", "xmlrpc": "1.0.2" @@ -20,6 +21,7 @@ "chai": "~1.7.0", "mocha": "~1.12.0" }, + "main": "./lib/opennebula", "scripts": { "test": "./node_modules/mocha/bin/mocha -R spec" } diff --git a/test/host.js b/test/host.js index 2e7c8a2..386703a 100644 --- a/test/host.js +++ b/test/host.js @@ -1,5 +1,6 @@ var expect = require('chai').expect; -var one = require('./spec_helper').one; +var spec = require('./spec_helper'); +var one = spec.one; describe("#host", function() { @@ -8,7 +9,7 @@ describe("#host", function() { it("should fetch host info", function(done) { this.timeout(5000); - var host = one.getHost(1); + var host = one.getHost(spec.defaultHost); host.info(function(err, data) { expect(err).to.be.null; diff --git a/test/spec_helper.js b/test/spec_helper.js index d36b533..1641c07 100644 --- a/test/spec_helper.js +++ b/test/spec_helper.js @@ -3,5 +3,7 @@ var OpenNebula = require('../lib/opennebula'); var one = new OpenNebula(process.env.ONE_CREDENTIALS, process.env.ONE_HOST); module.exports = { - 'one': one + 'one': one, + 'defaultTemplate': 4, + 'defaultHost': 1 }; diff --git a/test/template.js b/test/template.js index 12e563f..cee8cc9 100644 --- a/test/template.js +++ b/test/template.js @@ -1,5 +1,6 @@ var expect = require('chai').expect; -var one = require('./spec_helper').one; +var spec = require('./spec_helper'); +var one = spec.one; describe("#template", function() { @@ -8,7 +9,7 @@ describe("#template", function() { it("should fetch vm info", function(done) { this.timeout(5000); - var template = one.getTemplate(4); + var template = one.getTemplate(spec.defaultTemplate); template.info(function(err, data) { expect(err).to.be.null; @@ -21,7 +22,7 @@ describe("#template", function() { it("should create a vm from template", function(done) { this.timeout(5000); - var template = one.getTemplate(4); + var template = one.getTemplate(spec.defaultTemplate); template.instantiate('test_one', undefined, undefined, function(err, vm) { expect(err).to.be.null;