This commit is contained in:
Peter Cottle 2015-04-20 17:25:19 +10:00
parent 97723a1150
commit b0bb3c1481
2 changed files with 9 additions and 10 deletions

View file

@ -1,15 +1,15 @@
var _ = require('underscore');
var base = require('./base');
describe('GitEngine Levels', function() {
it('solves levels', function() {
var sequences = require('../../levels/index').levelSequences;
_.each(Object.keys(sequences), function(sequenceKey) {
Object.keys(sequences).forEach(function(sequenceKey) {
var levels = sequences[sequenceKey];
_.each(levels, function(levelBlob, index) {
Object.keys(levels).forEach(function(index) {
var levelBlob = levels[index];
console.log('testing level', levelBlob.name.en_US);
base.expectLevelSolved(levelBlob);
});
}.bind(this));
});
});
});

View file

@ -1,5 +1,3 @@
var _ = require('underscore');
var Command = require('../models/commandModel').Command;
describe('commands', function() {
@ -11,10 +9,11 @@ describe('commands', function() {
};
var c = new Command({rawStr: 'foo'});
_.each(testCases, function(expected, input) {
Object.keys(testCases).forEach(function(input) {
var expected = testCases[input];
var actual = c.replaceDotWithHead(input);
expect(actual).toBe(expected);
});
}.bind(this));
});
it('maps options and general args', function() {
@ -32,7 +31,7 @@ describe('commands', function() {
}];
var c = new Command({rawStr: 'foo'});
_.each(testCases, function(tCase) {
testCases.forEach(function(tCase) {
c.setOptionsMap(tCase.options);
c.setGeneralArgs(tCase.args);
c.mapDotToHead();
@ -49,7 +48,7 @@ describe('commands', function() {
).toBe(
j(tCase.gitOptions)
);
});
}.bind(this));
});
});