spec/support/ldap.rb
def mock_ldap_connection
  fake_ldap_connection = double("MockLDAP")
  allow(Ldap::Queries).to receive(:ldap_connection).and_return(fake_ldap_connection)
  fake_ldap_connection
end
# Mock out core ldap connection methods
# Critically: `ldap_connection` and `validate_ldap_response`
# It is expected that users of this will then mock queries/responses as needed for the context of the test(s)
Mock out core ldap connection methods
Critically: `ldap_connection` and `validate_ldap_response`
It is expected that users of this will then mock queries/responses as needed for the context of the test(s)
Mock out core ldap connection methods Critically : ` ldap_connection ` and ` validate_ldap_response ` It is expected that users of this will then mock queries / responses as needed for the context of the test ( s )
def mock_ldap_connection
  fake_ldap_connection = double("MockLDAP")
  allow(Ldap::Queries).to receive(:ldap_connection).and_return(fake_ldap_connection)
  fake_ldap_connection
end
def mock_ldap_connection fake_ldap_connection = double ( "MockLDAP" ) allow ( Ldap :: Queries ) . to receive ( :ldap_connection ) . and_return ( fake_ldap_connection ) fake_ldap_connection end
Mock out core ldap connection methods
Critically: `ldap_connection` and `validate_ldap_response`
It is expected that users of this will then mock queries/responses as needed for the context of the test(s)
Mock out core ldap connection methods Critically : ` ldap_connection ` and ` validate_ldap_response ` It is expected that users of this will then mock queries / responses as needed for the context of the test ( s )