Sha256: da88c9a7cb997104e1aeeae0d1ecc70e72c9152640be1c773f304103b6279f8b

Contents?: true

Size: 988 Bytes

Versions: 14

Compression:

Stored size: 988 Bytes

Contents

require "spec"
require "./atbash_cipher"

describe "Atbash" do
  describe "#encode" do
    it "encodes no" do
      Atbash.encode("no").should eq "ml"
    end

    pending "encodes yes" do
      Atbash.encode("yes").should eq "bvh"
    end

    pending "encode OMG" do
      Atbash.encode("OMG").should eq "lnt"
    end

    pending "encodes O M G spaces" do
      Atbash.encode("O M G").should eq "lnt"
    end

    pending "encode long words" do
      Atbash.encode("mindblowingly").should eq "nrmwy oldrm tob"
    end

    pending "encodes numbers" do
      Atbash.encode("Testing, 1 2 3, testing.").should eq "gvhgr mt123 gvhgr mt"
    end

    pending "encodes sentence" do
      Atbash.encode("Truth is fiction.").should eq "gifgs rhurx grlm"
    end

    pending "encodes all the things" do
      plaintext = "The quick brown fox jumps over the lazy dog."
      cipher = "gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt"
      Atbash.encode(plaintext).should eq cipher
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
trackler-2.0.0.3 tracks/crystal/exercises/atbash-cipher/atbash_cipher_spec.cr
trackler-2.0.0.2 tracks/crystal/exercises/atbash-cipher/atbash_cipher_spec.cr
trackler-2.0.0.1 tracks/crystal/exercises/atbash-cipher/atbash_cipher_spec.cr
trackler-2.0.0.0 tracks/crystal/exercises/atbash-cipher/atbash_cipher_spec.cr
trackler-1.0.4.1 tracks/crystal/exercises/atbash-cipher/atbash_cipher_spec.cr
trackler-1.0.4.0 tracks/crystal/exercises/atbash-cipher/atbash_cipher_spec.cr
trackler-1.0.3.0 tracks/crystal/exercises/atbash-cipher/atbash_cipher_spec.cr
trackler-1.0.2.1 tracks/crystal/exercises/atbash-cipher/atbash_cipher_spec.cr
trackler-1.0.2.0 tracks/crystal/exercises/atbash-cipher/atbash_cipher_spec.cr
trackler-1.0.1.2 tracks/crystal/exercises/atbash-cipher/atbash_cipher_spec.cr
trackler-1.0.1.1 tracks/crystal/exercises/atbash-cipher/atbash_cipher_spec.cr
trackler-1.0.1.0 tracks/crystal/exercises/atbash-cipher/atbash_cipher_spec.cr
trackler-1.0.0.1 tracks/crystal/exercises/atbash-cipher/atbash_cipher_spec.cr
trackler-1.0.0 tracks/crystal/exercises/atbash-cipher/atbash_cipher_spec.cr