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.139 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.138 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.137 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.136 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.135 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.134 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.133 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.132 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.131 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.130 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.129 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.128 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.127 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.126 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.125 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.124 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.123 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.122 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.121 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.120 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc