Skip to content

Commit

Permalink
minor tests fixes, v1.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
apocas committed Feb 24, 2015
1 parent 6b873b6 commit fc94057
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@

node_modules
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
"name": "opennebula",
"description": "OpenNebula XML-RPC API client.",
"version": "1.0.4",
"author": "Pedro Dias <[email protected]>",
"maintainers": [
"apocas <[email protected]>"
],
"repository": {
"type": "git",
"url": "https://github.com/apocas/node-one.git"
},
"bugs": {
"url": "https://github.com/apocas/node-one/issues"
},
"directories": {
"lib": "./lib"
},
"dependencies": {
"xml2js": "0.4.4",
"xmlrpc": "1.0.2"
Expand All @@ -20,6 +21,7 @@
"chai": "~1.7.0",
"mocha": "~1.12.0"
},
"main": "./lib/opennebula",
"scripts": {
"test": "./node_modules/mocha/bin/mocha -R spec"
}
Expand Down
5 changes: 3 additions & 2 deletions test/host.js
Original file line number Diff line number Diff line change
@@ -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() {
Expand All @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion test/spec_helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
7 changes: 4 additions & 3 deletions test/template.js
Original file line number Diff line number Diff line change
@@ -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() {
Expand All @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit fc94057

Please sign in to comment.