Sha256: 89fc11161c78f52383a83cb98475ba26feb4d19e9d04acf449bc8fca7a1443e0

Contents?: true

Size: 1.96 KB

Versions: 5

Compression:

Stored size: 1.96 KB

Contents

#--
# =============================================================================
# Copyright (c) 2004,2005 Jamis Buck (jamis_buck@byu.edu)
# All rights reserved.
#
# This source file is distributed as part of the Net::SSH Secure Shell Client
# library for Ruby. This file (and the library as a whole) may be used only as
# allowed by either the BSD license, or the Ruby license (or, by association
# with the Ruby license, the GPL). See the "doc" subdirectory of the Net::SSH
# distribution for the texts of these licenses.
# -----------------------------------------------------------------------------
# net-ssh website : http://net-ssh.rubyforge.org
# project website: http://rubyforge.org/projects/net-ssh
# =============================================================================
#++

$:.unshift "../../../lib"

require 'net/ssh/transport/ossl/buffer-factory'
require 'test/unit'

class TC_OSSLBufferFactory < Test::Unit::TestCase

  def setup
    @factory = Net::SSH::Transport::OSSL::BufferFactory.new
  end

  def test_reader
    reader = @factory.reader( "test" )
    assert_instance_of Net::SSH::Transport::OSSL::ReaderBuffer, reader
  end

  def test_reader_interface
    reader = @factory.reader( "test" )
    assert_respond_to reader, :read_key
    assert_respond_to reader, :read_keyblob
    assert_respond_to reader, :read_bignum
  end

  def test_reader_init
    reader = @factory.reader( "test" )
    assert_equal "test", reader.to_s
  end

  def test_buffer
    buffer = @factory.buffer
    assert_instance_of Net::SSH::Transport::OSSL::Buffer, buffer
  end

  def test_buffer_interface
    buffer = @factory.buffer
    assert_respond_to buffer, :read_key
    assert_respond_to buffer, :read_keyblob
    assert_respond_to buffer, :read_bignum
  end

  def test_buffer_init
    buffer = @factory.reader( "test" )
    assert_equal "test", buffer.to_s
  end

  def test_writer_buffer
    buffer = @factory.writer
    assert_instance_of Net::SSH::Util::WriterBuffer, buffer
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
net-ssh-0.9.0 test/transport/ossl/tc_buffer_factory.rb
net-ssh-1.0.1 test/transport/ossl/tc_buffer_factory.rb
net-ssh-1.0.0 test/transport/ossl/tc_buffer_factory.rb
net-ssh-1.0.3 test/transport/ossl/tc_buffer_factory.rb
net-ssh-1.0.2 test/transport/ossl/tc_buffer_factory.rb