Sha256: 045045d537dfb76963ed9b11e76497af03ab5ec5f90fd9602b05a0817cfa1f78

Contents?: true

Size: 1.85 KB

Versions: 146

Compression:

Stored size: 1.85 KB

Contents

component extends="testbox.system.BaseSpec" {

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

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

			describe( 'encode', function(){

				it( 'encode yes', function(){
					expect( SUT.encode( phrase='yes' ) ).toBe( 'bvh' );
				});

				it( 'encode no', function(){
					expect( SUT.encode( phrase='no' ) ).toBe( 'ml' );
				});

				it( 'encode OMG', function(){
					expect( SUT.encode( phrase='OMG' ) ).toBe( 'lnt' );
				});

				it( 'encode spaces', function(){
					expect( SUT.encode( phrase='O M G' ) ).toBe( 'lnt' );
				});

				it( 'encode mindblowingly', function(){
					expect( SUT.encode( phrase='mindblowingly' ) ).toBe( 'nrmwy oldrm tob' );
				});

				it( 'encode numbers', function(){
					expect( SUT.encode( phrase='Testing, 1 2 3,  testing.' ) ).toBe( 'gvhgr mt123 gvhgr mt' );
				});

				it( 'encode deep thought', function(){
					expect( SUT.encode( phrase='Truth is fiction.' ) ).toBe( 'gifgs rhurx grlm' );
				});

				it( 'encode all the letters', function(){
					expect( SUT.encode( phrase='The quick brown fox jumps over the lazy dog.' ) ).toBe( 'gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt' );
				});

			});

			describe( 'decode', function(){

				it( 'decode exercism', function(){
					expect( SUT.decode( phrase='vcvix rhn' ) ).toBe( 'exercism' );
				});

				it( 'decode a sentence', function(){
					expect( SUT.decode( phrase='zmlyh gzxov rhlug vmzhg vkkrm thglm v' ) ).toBe( 'anobstacleisoftenasteppingstone' );
				});

				it( 'decode numbers', function(){
					expect( SUT.decode( phrase='gvhgr mt123 gvhgr mt' ) ).toBe( 'testing123testing' );
				});

				it( 'decode all the letters', function(){
					expect( SUT.decode( phrase='gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt' ) ).toBe( 'thequickbrownfoxjumpsoverthelazydog' );
				});

			});

		});
		
	}
 
}

Version data entries

146 entries across 145 versions & 1 rubygems

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