Sha256: 6df4e8caaae712b33461040fa673ef0e0e54af04680ddc0a8420badcd4b2f28d

Contents?: true

Size: 1.68 KB

Versions: 255

Compression:

Stored size: 1.68 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

255 entries across 255 versions & 1 rubygems

Version Path
trackler-2.2.1.37 tracks/javascript/exercises/crypto-square/crypto-square.spec.js
trackler-2.2.1.36 tracks/javascript/exercises/crypto-square/crypto-square.spec.js
trackler-2.2.1.35 tracks/javascript/exercises/crypto-square/crypto-square.spec.js
trackler-2.2.1.34 tracks/javascript/exercises/crypto-square/crypto-square.spec.js
trackler-2.2.1.33 tracks/javascript/exercises/crypto-square/crypto-square.spec.js
trackler-2.2.1.32 tracks/javascript/exercises/crypto-square/crypto-square.spec.js
trackler-2.2.1.31 tracks/javascript/exercises/crypto-square/crypto-square.spec.js
trackler-2.2.1.30 tracks/javascript/exercises/crypto-square/crypto-square.spec.js
trackler-2.2.1.29 tracks/javascript/exercises/crypto-square/crypto-square.spec.js
trackler-2.2.1.28 tracks/javascript/exercises/crypto-square/crypto-square.spec.js
trackler-2.2.1.27 tracks/javascript/exercises/crypto-square/crypto-square.spec.js
trackler-2.2.1.26 tracks/javascript/exercises/crypto-square/crypto-square.spec.js
trackler-2.2.1.25 tracks/javascript/exercises/crypto-square/crypto-square.spec.js
trackler-2.2.1.24 tracks/javascript/exercises/crypto-square/crypto-square.spec.js
trackler-2.2.1.23 tracks/javascript/exercises/crypto-square/crypto-square.spec.js
trackler-2.2.1.22 tracks/javascript/exercises/crypto-square/crypto-square.spec.js
trackler-2.2.1.21 tracks/javascript/exercises/crypto-square/crypto-square.spec.js
trackler-2.2.1.20 tracks/javascript/exercises/crypto-square/crypto-square.spec.js
trackler-2.2.1.19 tracks/javascript/exercises/crypto-square/crypto-square.spec.js
trackler-2.2.1.18 tracks/javascript/exercises/crypto-square/crypto-square.spec.js