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.119 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.118 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.117 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.116 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.115 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.114 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.113 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.111 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.110 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.109 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.108 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.107 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.106 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.105 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc