Skip to content
This repository has been archived by the owner on Feb 1, 2019. It is now read-only.

Commit

Permalink
Add comments and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
M. Adam Kendall committed Mar 26, 2015
1 parent 8fcb72f commit 60a2f5d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
8 changes: 8 additions & 0 deletions engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,18 @@ HMDAEngine.prototype.getAPIURL = function() {
return this.apiURL;
};

/**
* Set the current year the engine is working against
* @param {string} year The year
*/
HMDAEngine.prototype.setRuleYear = function(year) {
this.currentYear = year;
};

/**
* Get the current year the engine is working against
* @return {string} The year
*/
HMDAEngine.prototype.getRuleYear = function() {
return this.currentYear;
};
Expand Down
11 changes: 11 additions & 0 deletions test/engineSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,17 @@ describe('Engine', function() {
});
});

describe('get/set/clear HMDA JSON', function() {
it('should get/set/clear HMDA JSON correctly', function(done) {
expect(_.isEqual(engine.getHmdaJson(), {}));
engine.setHmdaJson({'foo':'bar'});
expect(_.isEqual(engine.getHmdaJson(), {'foo':'bar'}));
engine.clearHmdaJson();
expect(_.isEqual(engine.getHmdaJson(), {}));
done();
});
});

describe('get/set debug level', function() {
it('should get/set debug level correctly', function(done) {
expect(engine.getDebug()).to.be(0);
Expand Down

0 comments on commit 60a2f5d

Please sign in to comment.