Sha256: 5f41137ef1127a8881a3a63402eaf0659ecf5d142e7c3735b46a56de9b3384ab

Contents?: true

Size: 1.34 KB

Versions: 19

Compression:

Stored size: 1.34 KB

Contents

require 'al-test-utils'

class TestConfiguration < Test::Unit::TestCase
  priority :must

  priority :normal
  def test_prepare_configuration_with_silent_uri
    configuration = {
      :base => "dc=example,dc=com",
      :password => "secret",
      :uri => "ldap://example.com/dc=ignore,dc=me"
    }
    prepared_configuration =
      ActiveLdap::Base.prepare_configuration(configuration)
    assert_equal({
                   :host => "example.com",
                   :port => 389,
                   :base => "dc=example,dc=com",
                   :password => "secret",
                 },
                 prepared_configuration)
  end

  def test_prepare_configuration_with_detailed_uri
    bind_dn = "cn=admin,dc=example,dc=com"
    configuration = {
      :host => "example.net",
      :uri => "ldaps://example.com/dc=example,dc=com??sub??!bindname=#{CGI.escape(bind_dn)}"
    }
    prepared_configuration =
      ActiveLdap::Base.prepare_configuration(configuration)
    assert_equal({
                   :host => "example.net",
                   :port => 636,
                   :method => :ssl,
                   :base => "dc=example,dc=com",
                   :scope => "sub",
                   :bind_dn => "cn=admin,dc=example,dc=com",
                   :allow_anonymous => false,
                 },
                 prepared_configuration)
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
activeldap-7.2.1 test/test_configuration.rb
activeldap-7.2.0 test/test_configuration.rb
activeldap-7.0.0 test/test_configuration.rb
activeldap-6.1.0 test/test_configuration.rb
activeldap-6.0.4 test/test_configuration.rb
activeldap-6.0.3 test/test_configuration.rb
activeldap-6.0.2 test/test_configuration.rb
activeldap-6.0.1 test/test_configuration.rb
activeldap-6.0.0 test/test_configuration.rb
activeldap-5.2.4 test/test_configuration.rb
activeldap-5.2.3 test/test_configuration.rb
activeldap-5.2.2 test/test_configuration.rb
activeldap-5.2.1 test/test_configuration.rb
activeldap-5.2.0 test/test_configuration.rb
activeldap-5.1.1 test/test_configuration.rb
activeldap-5.1.0 test/test_configuration.rb
activeldap-4.0.6 test/test_configuration.rb
activeldap-4.0.5 test/test_configuration.rb
activeldap-4.0.4 test/test_configuration.rb