I am using
gem 'tcr', github: 'robforman/tcr', tag: 'cf6b949ba0d98538bf6b3df0373001ef9ec3ef06' ie branch ruby-upgrade in Gemfile
- ruby version:
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
- rails version:
7.0.4.2
- net-ldap
0.17.1
The error is:
Minitest::UnexpectedError: NoMethodError: undefined method `read_ber' for #<TCR::RecordableTCPSocket:0x00007f70f20f9d20 @read_lock=#<Thread::Queue:0x00007f70f20f9c80>, @recording=[["write", "...some stuff..."]], @live=true, @socket=#<TCPSocket:(closed)>>
socket.read_ber(syntax) do |id, content_length|
^^^^^^^^^
Did you mean? read_nonblock
app/models/user.rb:55:in `ldap_client'
The code that is calling (app/models/user.rb) reads as follows:
def self.ldap_client(user_name, password)
auth = { method: :simple, username: sanitize_email(user_name), password: password }
ldap = Net::LDAP.new(
host: AD_HOST,
auth: auth
)
# debugger
ldap if ldap.bind # Error thrown on bind (line 55)
end
my test/test_helper.rb includes:
TCR.configure do |c|
c.cassette_library_dir = File.expand_path('cassettes/tcr', __dir__)
# ldap 389/tcp
# ldaps 636/tcp
c.hook_tcp_ports = ENV['DISABLE_TCR'].present? ? [] : [389, 636]
if ENV['TCR_MODE'] =~ /rec/i
c.hit_all = true
end
end
FYI
- It also reports an deprecation warning:
/home/vagrant/.gem/ruby/3.1.3/bundler/gems/tcr-cf6b949ba0d9/lib/tcr/cassette.rb:19: warning: File.exists? is deprecated; use File.exist? instead
I am using
gem 'tcr', github: 'robforman/tcr', tag: 'cf6b949ba0d98538bf6b3df0373001ef9ec3ef06'ie branchruby-upgradeinGemfileruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]7.0.4.20.17.1The error is:
The code that is calling (
app/models/user.rb) reads as follows:my
test/test_helper.rbincludes:FYI