Sha256: 286465e4510bee9ad8680c62101e8b80acf50cb3a6896dc7167dd1036c4f0a72

Contents?: true

Size: 1.7 KB

Versions: 141

Compression:

Stored size: 1.7 KB

Contents

var Crypto = require('./crypto-square');

describe('Crypto', function () {
  it('normalize strange characters', function () {
    var crypto = new Crypto('s#$%^&plunk');
    expect(crypto.normalizePlaintext()).toEqual('splunk');
  });

  xit('normalize numbers', function () {
    var crypto = new Crypto('1, 2, 3 GO!');
    expect(crypto.normalizePlaintext()).toEqual('123go');
  });

  xit('size of small square', function () {
    var crypto = new Crypto('1234');
    expect(crypto.size()).toEqual(2);
  });

  xit('size of small square with additional non-nuber chars', function () {
    var crypto = new Crypto('1 2 3 4');
    expect(crypto.size()).toEqual(2);
  });

  xit('size of slightly larger square', function () {
    var crypto = new Crypto('123456789');
    expect(crypto.size()).toEqual(3);
  });

  xit('size of non-perfect square', function () {
    var crypto = new Crypto('123456789abc');
    expect(crypto.size()).toEqual(4);
  });

  xit('plain text segments', function () {
    var crypto = new Crypto('Never vex thine heart with idle woes');
    expect(crypto.plaintextSegments()).toEqual(['neverv', 'exthin', 'eheart', 'withid', 'lewoes']);
  });

  xit('plain text segments', function () {
    var crypto = new Crypto('ZOMG! ZOMBIES!!!');
    expect(crypto.plaintextSegments()).toEqual(['zomg', 'zomb', 'ies']);
  });

  xit('cipher text', function () {
    var crypto = new Crypto('Time is an illusion. Lunchtime doubly so.');
    expect(crypto.ciphertext()).toEqual('tasneyinicdsmiohooelntuillibsuuml');
  });

  xit('cipher text', function () {
    var crypto = new Crypto('We all know interspecies romance is weird.');
    expect(crypto.ciphertext()).toEqual('wneiaweoreneawssciliprerlneoidktcms');
  });
});

Version data entries

141 entries across 141 versions & 1 rubygems

Version Path
trackler-2.2.1.139 tracks/javascript/exercises/crypto-square/crypto-square.spec.js
trackler-2.2.1.138 tracks/javascript/exercises/crypto-square/crypto-square.spec.js
trackler-2.2.1.137 tracks/javascript/exercises/crypto-square/crypto-square.spec.js
trackler-2.2.1.136 tracks/javascript/exercises/crypto-square/crypto-square.spec.js
trackler-2.2.1.135 tracks/javascript/exercises/crypto-square/crypto-square.spec.js
trackler-2.2.1.134 tracks/javascript/exercises/crypto-square/crypto-square.spec.js
trackler-2.2.1.133 tracks/javascript/exercises/crypto-square/crypto-square.spec.js
trackler-2.2.1.132 tracks/javascript/exercises/crypto-square/crypto-square.spec.js
trackler-2.2.1.131 tracks/javascript/exercises/crypto-square/crypto-square.spec.js
trackler-2.2.1.130 tracks/javascript/exercises/crypto-square/crypto-square.spec.js
trackler-2.2.1.129 tracks/javascript/exercises/crypto-square/crypto-square.spec.js
trackler-2.2.1.128 tracks/javascript/exercises/crypto-square/crypto-square.spec.js
trackler-2.2.1.127 tracks/javascript/exercises/crypto-square/crypto-square.spec.js
trackler-2.2.1.126 tracks/javascript/exercises/crypto-square/crypto-square.spec.js
trackler-2.2.1.125 tracks/javascript/exercises/crypto-square/crypto-square.spec.js
trackler-2.2.1.124 tracks/javascript/exercises/crypto-square/crypto-square.spec.js
trackler-2.2.1.123 tracks/javascript/exercises/crypto-square/crypto-square.spec.js
trackler-2.2.1.122 tracks/javascript/exercises/crypto-square/crypto-square.spec.js
trackler-2.2.1.121 tracks/javascript/exercises/crypto-square/crypto-square.spec.js
trackler-2.2.1.120 tracks/javascript/exercises/crypto-square/crypto-square.spec.js