Sha256: b58bd20e4b65efbc1b11382b092b5f84715e09c2e5873bd426449235747405d9

Contents?: true

Size: 1.63 KB

Versions: 233

Compression:

Stored size: 1.63 KB

Contents

require 'minitest/autorun'
require_relative 'rail_fence_cipher'

# rubocop:enable all
class RailFenceCipherTest < Minitest::Test
  def test_encode_with_empty_string
    assert_equal '', RailFenceCipher.encode('', 4)
  end

  def test_encode_with_one_rail
    skip
    assert_equal 'One rail, only one rail',
                 RailFenceCipher.encode('One rail, only one rail', 1)
  end

  def test_encode_with_two_rails
    skip
    assert_equal 'XXXXXXXXXOOOOOOOOO',
                 RailFenceCipher.encode('XOXOXOXOXOXOXOXOXO', 2)
  end

  def test_encode_with_three_rails
    skip
    assert_equal 'WECRLTEERDSOEEFEAOCAIVDEN',
                 RailFenceCipher.encode('WEAREDISCOVEREDFLEEATONCE', 3)
  end

  def test_encode_with_ending_in_the_middle
    skip
    assert_equal 'ESXIEECSR', RailFenceCipher.encode('EXERCISES', 4)
  end

  def test_encode_with_less_letters_than_rails
    skip
    assert_equal 'More rails than letters',
                 RailFenceCipher.encode('More rails than letters', 24)
  end

  def test_decode_with_empty_string
    skip
    assert_equal '', RailFenceCipher.decode('', 4)
  end

  def test_decode_with_one_rail
    skip
    assert_equal 'ABCDEFGHIJKLMNOP',
                 RailFenceCipher.decode('ABCDEFGHIJKLMNOP', 1)
  end

  def test_decode_with_two_rails
    skip
    assert_equal 'XOXOXOXOXOXOXOXOXO',
                 RailFenceCipher.decode('XXXXXXXXXOOOOOOOOO', 2)
  end

  def test_decode_with_three_rails
    skip
    assert_equal 'THEDEVILISINTHEDETAILS',
                 RailFenceCipher.decode('TEITELHDVLSNHDTISEIIEA', 3)
  end

  def test_bookkeeping
    skip
    assert_equal 1, RailFenceCipher::VERSION
  end
end

Version data entries

233 entries across 233 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/ruby/exercises/rail-fence-cipher/rail_fence_cipher_test.rb
trackler-2.2.1.179 tracks/ruby/exercises/rail-fence-cipher/rail_fence_cipher_test.rb
trackler-2.2.1.178 tracks/ruby/exercises/rail-fence-cipher/rail_fence_cipher_test.rb
trackler-2.2.1.177 tracks/ruby/exercises/rail-fence-cipher/rail_fence_cipher_test.rb
trackler-2.2.1.176 tracks/ruby/exercises/rail-fence-cipher/rail_fence_cipher_test.rb
trackler-2.2.1.175 tracks/ruby/exercises/rail-fence-cipher/rail_fence_cipher_test.rb
trackler-2.2.1.174 tracks/ruby/exercises/rail-fence-cipher/rail_fence_cipher_test.rb
trackler-2.2.1.173 tracks/ruby/exercises/rail-fence-cipher/rail_fence_cipher_test.rb
trackler-2.2.1.172 tracks/ruby/exercises/rail-fence-cipher/rail_fence_cipher_test.rb
trackler-2.2.1.171 tracks/ruby/exercises/rail-fence-cipher/rail_fence_cipher_test.rb
trackler-2.2.1.170 tracks/ruby/exercises/rail-fence-cipher/rail_fence_cipher_test.rb
trackler-2.2.1.169 tracks/ruby/exercises/rail-fence-cipher/rail_fence_cipher_test.rb
trackler-2.2.1.167 tracks/ruby/exercises/rail-fence-cipher/rail_fence_cipher_test.rb
trackler-2.2.1.166 tracks/ruby/exercises/rail-fence-cipher/rail_fence_cipher_test.rb
trackler-2.2.1.165 tracks/ruby/exercises/rail-fence-cipher/rail_fence_cipher_test.rb
trackler-2.2.1.164 tracks/ruby/exercises/rail-fence-cipher/rail_fence_cipher_test.rb
trackler-2.2.1.163 tracks/ruby/exercises/rail-fence-cipher/rail_fence_cipher_test.rb
trackler-2.2.1.162 tracks/ruby/exercises/rail-fence-cipher/rail_fence_cipher_test.rb
trackler-2.2.1.161 tracks/ruby/exercises/rail-fence-cipher/rail_fence_cipher_test.rb
trackler-2.2.1.160 tracks/ruby/exercises/rail-fence-cipher/rail_fence_cipher_test.rb