summaryrefslogtreecommitdiff
path: root/test/transport/test_identity_cipher.rb
blob: 3f332db277a521702bd03248a3aae3234088a19e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
require 'common'
require 'net/ssh/transport/identity_cipher'

module Transport
  class TestIdentityCipher < NetSSHTest
    def test_block_size_should_be_8
      assert_equal 8, cipher.block_size
    end

    def test_encrypt_should_return_self
      assert_equal cipher, cipher.encrypt
    end

    def test_decrypt_should_return_self
      assert_equal cipher, cipher.decrypt
    end

    def test_update_should_return_argument
      assert_equal "hello, world", cipher.update("hello, world")
    end

    def test_final_should_return_empty_string
      assert_equal "", cipher.final
    end

    def test_name_should_be_identity
      assert_equal "identity", cipher.name
    end

    private

    def cipher
      Net::SSH::Transport::IdentityCipher
    end
  end
end