Skip to content

Commit e07b7dd

Browse files
author
Tatsuya Sato
committed
Add spec to reproduce FilterPraser.parse fails with multibyte char
1 parent 8a18267 commit e07b7dd

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

spec/unit/ldap/filter_parser_spec.rb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# encoding: utf-8
2+
require 'spec_helper'
3+
4+
describe Net::LDAP::Filter::FilterParser do
5+
6+
describe "#parse" do
7+
context "Given ASCIIs as filter string" do
8+
let(:filter_string) { "(&(objectCategory=person)(objectClass=user))" }
9+
specify "should generate filter object" do
10+
expect(Net::LDAP::Filter::FilterParser.parse(filter_string)).to be_a Net::LDAP::Filter
11+
end
12+
end
13+
context "Given string including multibyte chars as filter string" do
14+
let(:filter_string) { "(cn=名前)" }
15+
specify "should generate filter object" do
16+
expect(Net::LDAP::Filter::FilterParser.parse(filter_string)).to be_a Net::LDAP::Filter
17+
end
18+
end
19+
end
20+
end

0 commit comments

Comments
 (0)