Skip to content

Commit 54dcd12

Browse files
committed
Move bind integration test under test/integration/
Use an abstract integration test case.
1 parent 26ebfff commit 54dcd12

File tree

2 files changed

+22
-21
lines changed

2 files changed

+22
-21
lines changed

test/test_integration.rb renamed to test/integration/test_bind.rb

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,6 @@
11
require_relative 'test_helper'
22

3-
class TestLDAPIntegration < Test::Unit::TestCase
4-
5-
# If integration tests aren't enabled, noop these tests.
6-
if !INTEGRATION
7-
def run(*)
8-
self
9-
end
10-
end
11-
12-
def setup
13-
@service = MockInstrumentationService.new
14-
@ldap = Net::LDAP.new \
15-
host: 'localhost',
16-
port: 389,
17-
admin_user: 'uid=admin,dc=rubyldap,dc=com',
18-
admin_password: 'passworD1',
19-
search_domains: %w(dc=rubyldap,dc=com),
20-
uid: 'uid',
21-
instrumentation_service: @service
22-
end
23-
3+
class TestBindIntegration < LDAPIntegrationTestCase
244
def test_bind_success
255
assert @ldap.bind(method: :simple, username: "uid=user1,ou=People,dc=rubyldap,dc=com", password: "passworD1"), @ldap.get_operation_result.inspect
266
end

test/test_helper.rb

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,24 @@ def subscribe(event)
3131
@events[event]
3232
end
3333
end
34+
35+
class LDAPIntegrationTestCase < Test::Unit::TestCase
36+
# If integration tests aren't enabled, noop these tests.
37+
if !INTEGRATION
38+
def run(*)
39+
self
40+
end
41+
end
42+
43+
def setup
44+
@service = MockInstrumentationService.new
45+
@ldap = Net::LDAP.new \
46+
host: 'localhost',
47+
port: 389,
48+
admin_user: 'uid=admin,dc=rubyldap,dc=com',
49+
admin_password: 'passworD1',
50+
search_domains: %w(dc=rubyldap,dc=com),
51+
uid: 'uid',
52+
instrumentation_service: @service
53+
end
54+
end

0 commit comments

Comments
 (0)