--- t/ldap-rewrite.pl 2010/02/22 22:44:56 71 +++ t/ldap-rewrite.t 2010/02/24 18:07:12 82 @@ -3,7 +3,7 @@ use warnings; use strict; -use Test::More tests => 8; +use Test::More tests => 9; use Data::Dump qw(dump); BEGIN { @@ -11,7 +11,7 @@ } our $config; -ok( require "t/config.pl", 'config.pl' ); +ok( require( ( shift @ARGV || 't/config.pl' ) ), 'config.pl' ); sub ldap_check_error { my $o = shift; @@ -28,7 +28,19 @@ ldap_check_error $search; foreach my $entry ( $search->entries ) { - diag dump $entry; + +# diag dump $entry; + $entry->dump; + + my $missing = 0; + my @required = @{ $config->{attributes_required} }; + foreach my $attr ( @required ) { + next if grep { /^\Q$attr\E$/i } $entry->attributes; + $missing++; + diag "$missing missing $attr\n"; + } + + ok( ! $missing, "attributes " . dump( @required ) ); } ok( $ldap->unbind, 'unbind' );