2017-01-23 09:46:50 -08:00
|
|
|
var chai = require("chai");
|
2017-01-15 15:40:23 -03:00
|
|
|
var expect = chai.expect;
|
2017-01-23 09:46:50 -08:00
|
|
|
var classMM = require("../../js/class.js"); // require for load module.js
|
|
|
|
var moduleMM = require("../../js/module.js")
|
2017-01-15 15:40:23 -03:00
|
|
|
|
2017-01-23 09:46:50 -08:00
|
|
|
describe("Test function cmpVersions in js/module.js", function() {
|
2017-01-15 15:40:23 -03:00
|
|
|
|
2017-01-23 09:46:50 -08:00
|
|
|
it("should return -1 when comparing 2.1 to 2.2", function() {
|
|
|
|
expect(moduleMM._test.cmpVersions("2.1", "2.2")).to.equal(-1);
|
2017-01-15 15:40:23 -03:00
|
|
|
});
|
|
|
|
|
2017-01-23 09:46:50 -08:00
|
|
|
it("should be return 0 when comparing 2.2 to 2.2", function() {
|
|
|
|
expect(moduleMM._test.cmpVersions("2.2", "2.2")).to.equal(0);
|
2017-01-15 15:40:23 -03:00
|
|
|
});
|
|
|
|
|
2017-01-23 09:46:50 -08:00
|
|
|
it("should be return 1 when comparing 1.1 to 1.0", function() {
|
|
|
|
expect(moduleMM._test.cmpVersions("1.1", "1.0")).to.equal(1);
|
2017-01-15 15:40:23 -03:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|