/du_decipher/test/test_decipher.rb

https://github.com/krutsmat/MI-RUB · Ruby · 20 lines · 17 code · 3 blank · 0 comment · 0 complexity · 2f54222c880e762f3bfb4c336095035c MD5 · raw file

  1. require "test/unit"
  2. require_relative "../lib/decipher/decipher"
  3. class TestDecipher < Test::Unit::TestCase
  4. def test_decode
  5. input = "1JKJ'pz'{ol'{yhklthyr'vm'{ol'Jvu{yvs'Kh{h'Jvywvyh{pvu5"
  6. expected = "*CDC is the trademark of the Control Data Corporation."
  7. assert_equal(expected, Decipher.decode(input))
  8. input = "1PIT'pz'h'{yhklthyr'vm'{ol'Pu{lyuh{pvuhs'I|zpulzz'Thjopul'Jvywvyh{pvu5"
  9. expected = "*IBM is a trademark of the International Business Machine Corporation."
  10. assert_equal(expected, Decipher.decode(input))
  11. input = "1KLJ'pz'{ol'{yhklthyr'vm'{ol'Kpnp{hs'Lx|pwtlu{'Jvywvyh{pvu5"
  12. expected = "*DEC is the trademark of the Digital Equipment Corporation."
  13. assert_equal(expected, Decipher.decode(input))
  14. end
  15. end