mirror of
https://github.com/redmine/redmine.git
synced 2025-11-10 23:36:01 +01:00
Replaced ruby-net-ldap with net-ldap 0.2.2 gem.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8751 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
36
vendor/gems/net-ldap-0.2.2/spec/integration/ssl_ber_spec.rb
vendored
Normal file
36
vendor/gems/net-ldap-0.2.2/spec/integration/ssl_ber_spec.rb
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
require 'spec_helper'
|
||||
|
||||
require 'net/ldap'
|
||||
|
||||
describe "BER serialisation (SSL)" do
|
||||
# Transmits str to #to and reads it back from #from.
|
||||
#
|
||||
def transmit(str)
|
||||
to.write(str)
|
||||
to.close
|
||||
|
||||
from.read
|
||||
end
|
||||
|
||||
attr_reader :to, :from
|
||||
before(:each) do
|
||||
@from, @to = IO.pipe
|
||||
|
||||
# The production code operates on sockets, which do need #connect called
|
||||
# on them to work. Pipes are more robust for this test, so we'll skip
|
||||
# the #connect call since it fails.
|
||||
flexmock(OpenSSL::SSL::SSLSocket).
|
||||
new_instances.should_receive(:connect => nil)
|
||||
|
||||
@to = Net::LDAP::Connection.wrap_with_ssl(to)
|
||||
@from = Net::LDAP::Connection.wrap_with_ssl(from)
|
||||
end
|
||||
|
||||
it "should transmit strings" do
|
||||
transmit('foo').should == 'foo'
|
||||
end
|
||||
it "should correctly transmit numbers" do
|
||||
to.write 1234.to_ber
|
||||
from.read_ber.should == 1234
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user