Skip to content

Commit 9315cee

Browse files
committed
Use port from options
We don't care too much about the port in testing. Using the port in the options allows us to test against ApacheDS and OpenLDAP without adding any additional conditionals.
1 parent 7be5c55 commit 9315cee

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/ldap_test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@ def test_connection_with_default_options
1010
end
1111

1212
def test_connection_with_list_of_hosts_with_one_valid_host
13-
ldap = GitHub::Ldap.new(options.merge(hosts: [["localhost", 3897]]))
13+
ldap = GitHub::Ldap.new(options.merge(hosts: [["localhost", options[:port]]]))
1414
assert ldap.test_connection, "Ldap connection expected to succeed"
1515
end
1616

1717
def test_connection_with_list_of_hosts_with_first_valid
18-
ldap = GitHub::Ldap.new(options.merge(hosts: [["localhost", 3897], ["invalid.local", 3897]]))
18+
ldap = GitHub::Ldap.new(options.merge(hosts: [["localhost", options[:port]], ["invalid.local", options[:port]]]))
1919
assert ldap.test_connection, "Ldap connection expected to succeed"
2020
end
2121

2222
def test_connection_with_list_of_hosts_with_first_invalid
23-
ldap = GitHub::Ldap.new(options.merge(hosts: [["invalid.local", 3897], ["localhost", 3897]]))
23+
ldap = GitHub::Ldap.new(options.merge(hosts: [["invalid.local", options[:port]], ["localhost", options[:port]]]))
2424
assert ldap.test_connection, "Ldap connection expected to succeed"
2525
end
2626

0 commit comments

Comments
 (0)