#18 LDAP::LDIF.mods_to_ldif fails in ruby1.9

open
nobody
None
5
2010-10-05
2010-10-05
Anonymous
No

The following unit test fails with ruby1.9 while works with ruby1.8.7:

#!/usr/bin/env ruby
#encoding: UTF-8

require 'rubygems'
gem 'test-unit'
require 'test/unit'
require 'ldap'
require 'ldap/ldif'

p RUBY_VERSION

def test_ldap_mod_to_ldif
mod = LDAP::Mod.new(LDAP::LDAP_MOD_REPLACE, "uid", ["tizio", "caio"])
assert mod
assert LDAP::LDIF.mods_to_ldif("uid=tizio,ou=people,dc=test,dc=com", mod)
end
end

as far as I can see, it looks it relies on String.respond_to? :each which works on ruby1.8.7 and not in ruby1.9

Discussion


  • Anonymous
    2010-10-05

    I think it could be enought to change line 510 in ldif.rb to:

    ldif << LDIF.to_ldif( change_type, [ mod.mod_type ] )