File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ require_relative 'test_helper'
2+
3+ if !INTEGRATION
4+ puts "Skipping integration tests..."
5+ else
6+ class TestLDAPInstrumentation < Test ::Unit ::TestCase
7+ def setup
8+ @service = MockInstrumentationService . new
9+ @ldap = Net ::LDAP . new \
10+ host : 'localhost' ,
11+ port : 389 ,
12+ admin_user : 'uid=admin,dc=rubyldap,dc=com' ,
13+ admin_password : 'passworD1' ,
14+ search_domains : %w( dc=rubyldap,dc=com ) ,
15+ uid : 'uid' ,
16+ instrumentation_service : @service
17+ end
18+
19+ def test_bind_success
20+ assert @ldap . bind ( method : :simple , username : "user1" , password : "passworD1" )
21+ end
22+
23+ def test_bind_success_anonymous
24+ assert @ldap . bind ( method : :simple , username : "user1" , password : "" )
25+ end
26+
27+ def test_bind_fail
28+ refute @ldap . bind ( method : :simple , username : "user1" , password : "not my password" )
29+ end
30+ end
31+ end
You can’t perform that action at this time.
0 commit comments