Sha256: dad2372d250742aa01df848cfb70005ca61420d0112cd188262f97b02897265f

Contents?: true

Size: 1.3 KB

Versions: 74

Compression:

Stored size: 1.3 KB

Contents

component extends="testbox.system.BaseSpec" {

	function beforeAll(){
	  SUT = createObject( 'ScrabbleScore' );
	}

	function run(){
	
		describe( "My ScrabbleScore class", function(){			

			it( 'lowercase letter', function(){
				expect( SUT.score( word='a' ) ).toBe( '1' );
			});

			it( 'uppercase letter', function(){
				expect( SUT.score( word='A' ) ).toBe( '1' );
			});

			it( 'valuable letter', function(){
				expect( SUT.score( word='f' ) ).toBe( '4' );
			});

			it( 'short word', function(){
				expect( SUT.score( word='at' ) ).toBe( '2' );
			});

			it( 'short, valuable word', function(){
				expect( SUT.score( word='zoo' ) ).toBe( '12' );
			});

			it( 'medium word', function(){
				expect( SUT.score( word='street' ) ).toBe( '6' );
			});

			it( 'medium, valuable word', function(){
				expect( SUT.score( word='quirky' ) ).toBe( '22' );
			});

			it( 'long, mixed-case word', function(){
				expect( SUT.score( word='OxyphenButazone' ) ).toBe( '41' );
			});

			it( 'english-like word', function(){
				expect( SUT.score( word='pinata' ) ).toBe( '8' );
			});

			it( 'empty input', function(){
				expect( SUT.score( word='' ) ).toBe( '0' );
			});

			it( 'entire alphabet available', function(){
				expect( SUT.score( word='abcdefghijklmnopqrstuvwxyz' ) ).toBe( '87' );
			});

		});
		
	}
 
}

Version data entries

74 entries across 74 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.179 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.178 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.177 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.176 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.175 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.174 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.173 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.172 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.171 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.170 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.169 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.167 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.166 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.165 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.164 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.163 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.162 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.161 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.160 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc