Sha256: b8a4217254536962161d8f1c85c1eb093ad2e7127723ee08fd0fcacbfc72a9b0

Contents?: true

Size: 1.03 KB

Versions: 151

Compression:

Stored size: 1.03 KB

Contents

#!/usr/bin/env ruby
gem 'minitest', '>= 5.0.0'
require 'minitest/autorun'
require_relative 'atbash_cipher'

class AtbashTest < Minitest::Test
  def test_encode_no
    assert_equal 'ml', Atbash.encode('no')
  end

  def test_encode_yes
    skip
    assert_equal 'bvh', Atbash.encode('yes')
  end

  def test_encode_OMG
    skip
    assert_equal 'lnt', Atbash.encode('OMG')
  end

  def test_encode_O_M_G
    skip
    assert_equal 'lnt', Atbash.encode('O M G')
  end

  def test_encode_long_word
    skip
    assert_equal 'nrmwy oldrm tob', Atbash.encode('mindblowingly')
  end

  def test_encode_numbers
    skip
    assert_equal('gvhgr mt123 gvhgr mt',
                 Atbash.encode('Testing, 1 2 3, testing.'))
  end

  def test_encode_sentence
    skip
    assert_equal 'gifgs rhurx grlm', Atbash.encode('Truth is fiction.')
  end

  def test_encode_all_the_things
    skip
    plaintext = 'The quick brown fox jumps over the lazy dog.'
    cipher = 'gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt'
    assert_equal cipher, Atbash.encode(plaintext)
  end
end

Version data entries

151 entries across 151 versions & 1 rubygems

Version Path
trackler-2.1.0.7 tracks/ruby/exercises/atbash-cipher/atbash_cipher_test.rb
trackler-2.1.0.6 tracks/ruby/exercises/atbash-cipher/atbash_cipher_test.rb
trackler-2.1.0.5 tracks/ruby/exercises/atbash-cipher/atbash_cipher_test.rb
trackler-2.1.0.4 tracks/ruby/exercises/atbash-cipher/atbash_cipher_test.rb
trackler-2.1.0.3 tracks/ruby/exercises/atbash-cipher/atbash_cipher_test.rb
trackler-2.1.0.2 tracks/ruby/exercises/atbash-cipher/atbash_cipher_test.rb
trackler-2.1.0.1 tracks/ruby/exercises/atbash-cipher/atbash_cipher_test.rb
trackler-2.1.0.0 tracks/ruby/exercises/atbash-cipher/atbash_cipher_test.rb
trackler-2.0.8.55 tracks/ruby/exercises/atbash-cipher/atbash_cipher_test.rb
trackler-2.0.8.54 tracks/ruby/exercises/atbash-cipher/atbash_cipher_test.rb
trackler-2.0.8.53 tracks/ruby/exercises/atbash-cipher/atbash_cipher_test.rb
trackler-2.0.8.52 tracks/ruby/exercises/atbash-cipher/atbash_cipher_test.rb
trackler-2.0.8.51 tracks/ruby/exercises/atbash-cipher/atbash_cipher_test.rb
trackler-2.0.8.50 tracks/ruby/exercises/atbash-cipher/atbash_cipher_test.rb
trackler-2.0.8.49 tracks/ruby/exercises/atbash-cipher/atbash_cipher_test.rb
trackler-2.0.8.48 tracks/ruby/exercises/atbash-cipher/atbash_cipher_test.rb
trackler-2.0.8.47 tracks/ruby/exercises/atbash-cipher/atbash_cipher_test.rb
trackler-2.0.8.46 tracks/ruby/exercises/atbash-cipher/atbash_cipher_test.rb
trackler-2.0.8.45 tracks/ruby/exercises/atbash-cipher/atbash_cipher_test.rb
trackler-2.0.8.44 tracks/ruby/exercises/atbash-cipher/atbash_cipher_test.rb