File: test_auth_adapter.rb

package info (click to toggle)
ruby-net-ldap 0.19.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 640 kB
  • sloc: ruby: 4,583; sh: 53; makefile: 4
file content (15 lines) | stat: -rw-r--r-- 404 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
require 'test_helper'

class TestAuthAdapter < Test::Unit::TestCase
  class FakeSocket
    def initialize(*args)
    end
  end

  def test_undefined_auth_adapter
    conn = Net::LDAP::Connection.new(host: 'ldap.example.com', port: 379, :socket_class => FakeSocket)
    assert_raise Net::LDAP::AuthMethodUnsupportedError, "Unsupported auth method (foo)" do
      conn.bind(method: :foo)
    end
  end
end