Sha256: d8ec268b5a71312a3c5b6bffe162b64b9871d10613f81fe1acf49d27905ace6b

Contents?: true

Size: 1.31 KB

Versions: 72

Compression:

Stored size: 1.31 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( input='a' ) ).toBe( '1' );
			});

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

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

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

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

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

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

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

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

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

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

		});
		
	}
 
}

Version data entries

72 entries across 71 versions & 1 rubygems

Version Path
trackler-2.2.1.104 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.103 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.102 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.101 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.100 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.99 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.98 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.97 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.96 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.95 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.94 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.93 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.92 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.91 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.90 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.89 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.88 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.87 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.86 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.85 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc