File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change 2
2
3
3
describe Net ::LDAP do
4
4
describe "initialize" do
5
- context "on instrumentation_service configuration " do
5
+ context "when instrumentation is configured " do
6
6
before do
7
7
@tcp_socket = flexmock ( :connection )
8
8
@tcp_socket . should_receive ( :close )
9
9
flexmock ( TCPSocket ) . should_receive ( :new ) . and_return ( @tcp_socket )
10
10
@service = MockInstrumentationService . new
11
11
end
12
12
13
- it "should set the service object and instrument network calls" do
14
- ldap = Net ::LDAP . new ( :server => 'test.mocked.com' , :port => 636 ,
15
- :instrumentation_service => @service )
13
+ subject do
14
+ Net ::LDAP . new \
15
+ :server => "test.mocked.com" , :port => 636 ,
16
+ :instrumentation_service => @service
17
+ end
16
18
19
+ it "should set the service object and instrument network calls" do
17
20
@tcp_socket . should_receive ( :write ) . and_return ( bytes_written = 1 )
18
21
19
22
write_events = @service . subscribe "write.net_ldap_connection"
24
27
read_result = [ 2 , ber ]
25
28
@tcp_socket . should_receive ( :read_ber ) . and_return ( read_result )
26
29
27
- ldap . bind . should be_true
30
+ subject . bind . should be_true
28
31
29
32
# a write event
30
33
payload , result = write_events . pop
You can’t perform that action at this time.
0 commit comments