ruby-ldap/ruby-net-ldap — pull request #82 by smangelsdorf (2014-04-05 06:04:52+00:00)
Title: Fix for test failures due to String encoding and ruby-openssl issues

Two issues were causing test failures for me:

1. Ruby 2.x defaults to UTF-8 encoding for string literals, so the "expected" values for the BER tests were not being compared correctly. The new `String#b` method converts a string to ASCII-8BIT encoding without doing any actual translation.
2. For some reason, `OpenSSL::SSL::SSLSocket#sync_close` is not working. I've tried this on two machines, across many Ruby versions and I see the same issue:
- Ruby 1.9.3-p545 on Arch Linux (up-to-date this morning)
- Ruby 2.1.1 on Arch Linux
- Ruby 1.9.3-p545 on OS X 10.9.2
- Ruby 2.0.0-p451 on OS X 10.9.2
- Ruby 2.1.1 on OS X 10.9.2

All have the same problem, and all are fixed by 839c50f. I've additionally added a timeout to the test case which was failing, as the failures were causing the test suite to block on pipe read until killed.

I've tested in JRuby 1.7.9 and these changes do not introduce any new failures, but the two existing failures remain.

Test output before these changes: https://gist.github.com/smangelsdorf/9987870