! Fixes all tests
Some code has been removed. Version control is not synonymous with code storage - if you're not using it now, you probably don't have working tests and the code will be buggy anyway. Write it when you need it.
This commit is contained in:
parent
75f37c58b9
commit
1509aa8ef6
16 changed files with 164 additions and 166 deletions
33
spec/integration/ssl_ber_spec.rb
Normal file
33
spec/integration/ssl_ber_spec.rb
Normal file
|
@ -0,0 +1,33 @@
|
|||
require 'spec_helper'
|
||||
|
||||
require 'socket'
|
||||
require 'openssl'
|
||||
|
||||
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
|
||||
|
||||
@to = Net::LDAP::SSLSocket.wrap(to)
|
||||
@from = Net::LDAP::SSLSocket.wrap(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
|
2
spec/spec.opts
Normal file
2
spec/spec.opts
Normal file
|
@ -0,0 +1,2 @@
|
|||
--format specdoc
|
||||
--colour
|
1
spec/spec_helper.rb
Normal file
1
spec/spec_helper.rb
Normal file
|
@ -0,0 +1 @@
|
|||
|
18
spec/unit/ber/ber_spec.rb
Normal file
18
spec/unit/ber/ber_spec.rb
Normal file
|
@ -0,0 +1,18 @@
|
|||
require 'spec_helper'
|
||||
|
||||
require 'net/ber'
|
||||
require 'net/ldap'
|
||||
|
||||
describe "Ber encoding of various types" do
|
||||
def properly_encode_and_decode
|
||||
simple_matcher('properly encode and decode') do |given|
|
||||
given.to_ber.read_ber.should == given
|
||||
end
|
||||
end
|
||||
|
||||
context "array" do
|
||||
it "should properly encode []" do
|
||||
[].should properly_encode_and_decode
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue