Skip to content

Commit f6ad189

Browse files
committed
use fake for auth adapter test
1 parent 259f18a commit f6ad189

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/test_auth_adapter.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
require 'test_helper'
22

33
class TestAuthAdapter < Test::Unit::TestCase
4+
class FakeSocket
5+
def initialize(*args)
6+
end
7+
end
8+
49
def test_undefined_auth_adapter
5-
flexmock(TCPSocket).should_receive(:new).ordered.with('ldap.example.com', 379).once.and_return(nil)
610
conn = Net::LDAP::Connection.new(host: 'ldap.example.com', port: 379)
11+
conn.socket_class = FakeSocket
712
assert_raise Net::LDAP::AuthMethodUnsupportedError, "Unsupported auth method (foo)" do
813
conn.bind(method: :foo)
914
end

0 commit comments

Comments
 (0)