Skip to content

Instantly share code, notes, and snippets.

@burtlo
Created July 10, 2013 18:13
Show Gist options
  • Save burtlo/5968700 to your computer and use it in GitHub Desktop.
Save burtlo/5968700 to your computer and use it in GitHub Desktop.
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