require File.expand_path('../spec_helper', File.dirname(__FILE__)) describe 'Connection' do it 'accepts a proc for ldap_config' do ::Devise.ldap_config = Proc.new() {{ 'host' => 'localhost', 'port' => 3389, 'base' => 'ou=testbase,dc=test,dc=com', 'attribute' => 'cn', }} connection = Devise::LDAP::Connection.new() expect(connection.ldap.base).to eq('ou=testbase,dc=test,dc=com') end end