2017-03-26 00:49:00 -03:00
|
|
|
var fs = require("fs");
|
|
|
|
var path = require("path");
|
|
|
|
var chai = require("chai");
|
|
|
|
var expect = chai.expect;
|
|
|
|
var vm = require("vm");
|
|
|
|
|
|
|
|
|
|
|
|
describe("Functions into modules/default/calendar/calendar.js", function() {
|
|
|
|
|
|
|
|
// Fake for use by calendar.js
|
|
|
|
Module = {}
|
|
|
|
Module.definitions = {};
|
|
|
|
Module.register = function (name, moduleDefinition) {
|
|
|
|
Module.definitions[name] = moduleDefinition;
|
|
|
|
};
|
|
|
|
|
2017-07-25 09:32:32 -04:00
|
|
|
before(function() {
|
|
|
|
// load calendar.js
|
|
|
|
require("../../../modules/default/calendar/calendar.js");
|
|
|
|
});
|
2017-03-26 00:49:00 -03:00
|
|
|
|
|
|
|
describe("capFirst", function() {
|
|
|
|
words = {
|
2017-04-19 00:45:55 -03:00
|
|
|
"rodrigo": "Rodrigo",
|
|
|
|
"123m": "123m",
|
|
|
|
"magic mirror": "Magic mirror",
|
|
|
|
",a": ",a",
|
2017-03-26 00:49:00 -03:00
|
|
|
"ñandú": "Ñandú"
|
|
|
|
};
|
|
|
|
|
|
|
|
Object.keys(words).forEach(word => {
|
|
|
|
it(`for ${word} should return ${words[word]}`, function() {
|
|
|
|
expect(Module.definitions.calendar.capFirst(word)).to.equal(words[word]);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|