Created
July 10, 2013 18:13
-
-
Save burtlo/5968700 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('./scrabble'); | |
describe('Scrabble', function() { | |
it("scores an empty word as zero",function() { | |
var score = Scrabble.score(""); | |
expect(score).toEqual(0); | |
}); | |
it("scores a null as zero",function() { | |
var score = Scrabble.score(null); | |
expect(score).toEqual(0); | |
}); | |
it("scores a very short word",function() { | |
var score = Scrabble.score("a"); | |
expect(score).toEqual(1); | |
}); | |
it("scores the word by the number of letters",function() { | |
var score = Scrabble.score("street"); | |
expect(score).toEqual(6); | |
}); | |
it("scores more complicated words with more",function() { | |
var score = Scrabble.score("quirky"); | |
expect(score).toEqual(22); | |
}); | |
it("scores case insensitive words",function() { | |
var score = Scrabble.score("MULTIBILLIONAIRE"); | |
expect(score).toEqual(20); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment