Skip to content

Commit f658a86

Browse files
committed
Add BER integration test for true value
1 parent a822560 commit f658a86

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

test/integration/test_ber.rb

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
require_relative '../test_helper'
2+
3+
class TestBERIntegration < LDAPIntegrationTestCase
4+
# Test whether the TRUE boolean value is encoded correctly by performing a
5+
# search operation.
6+
def test_true_ber_encoding
7+
# request these attrs to simplify test; use symbols to match Entry#attribute_names
8+
attrs = [:dn, :uid, :cn, :mail]
9+
10+
assert types_entry = @ldap.search(
11+
base: "dc=rubyldap,dc=com",
12+
filter: "(uid=user1)",
13+
size: 1,
14+
attributes: attrs,
15+
attributes_only: true
16+
).first
17+
18+
# matches attributes we requested
19+
assert_equal attrs, types_entry.attribute_names
20+
21+
# assert values are empty
22+
types_entry.each do |name, values|
23+
next if name == :dn
24+
assert values.empty?
25+
end
26+
27+
assert_includes Net::LDAP::ResultCodesSearchSuccess,
28+
@ldap.get_operation_result.code, "should be a successful search operation"
29+
end
30+
end

0 commit comments

Comments
 (0)