Sha256: 0b583d0f1f9f8ed8484df2c1df6d713c37dbaa4a1fbd8d8a1207a67827a8a949

Contents?: true

Size: 817 Bytes

Versions: 8

Compression:

Stored size: 817 Bytes

Contents

require File.join(File.dirname(__FILE__), 'test_helper.rb')

class GssContextTest < Test::Unit::TestCase

if Net::SSH::Kerberos::Drivers.available.include? 'GSS'

  def setup
    @gss = Net::SSH::Kerberos::Drivers::GSS::Context.new 
  end

  def teardown
    @gss.dispose
  end

  def test_create
    @gss.create ENV['USER'], Socket.gethostbyname(`hostname || echo "localhost"`.strip)[0]
    assert @gss.credentials?, "Should have acquired credentials"
  end

  def test_init
    test_create
    @gss.init nil
    state = @gss.send(:state)
    assert ! state.handle.nil?, "Should have provided an initial context"
    assert ! state.token.nil?, "Should have built an initial token"
    assert state.token.length.nonzero?, "Should have built an initial token"
  end

else
  def test_nothing; assert true end
end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
net-ssh-kerberos-0.2.7 test/gss_context_test.rb
net-ssh-kerberos-0.2.6 test/gss_context_test.rb
net-ssh-kerberos-0.2.5 test/gss_context_test.rb
net-ssh-kerberos-0.2.4 test/gss_context_test.rb
net-ssh-kerberos-0.2.3 test/gss_context_test.rb
net-ssh-kerberos-0.2.2 test/gss_context_test.rb
net-ssh-kerberos-0.2.1 test/gss_context_test.rb
net-ssh-kerberos-0.2.0 test/gss_context_test.rb