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.84 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.83 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.82 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.81 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.80 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.79 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.78 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.77 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.76 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.75 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.74 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.73 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.72 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.71 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.70 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.69 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.68 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.67 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.66 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc
trackler-2.2.1.65 tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc