BigW Consortium Gitlab

Commit fee3c95d by Michael Kozono

Remove redundant `is_`

parent 3e83ba34
......@@ -38,7 +38,7 @@ module Gitlab
# Returns the UID or DN in a normalized form
def self.normalize_uid_or_dn(uid_or_dn)
if is_dn?(uid_or_dn)
if dn?(uid_or_dn)
normalize_dn(uid_or_dn)
else
normalize_uid(uid_or_dn)
......@@ -49,7 +49,7 @@ module Gitlab
#
# An empty string is technically a valid DN (null DN), although we should
# never need to worry about that.
def self.is_dn?(uid_or_dn)
def self.dn?(uid_or_dn)
uid_or_dn.blank? || uid_or_dn.include?('=')
end
......
......@@ -96,7 +96,7 @@ describe Gitlab::LDAP::Person do
it_behaves_like 'normalizes the DN'
end
describe '.is_dn?' do
describe '.dn?' do
where(:test_description, :given, :expected) do
'given a DN with a single RDN' | 'uid=John C. Smith' | true
'given a DN with multiple RDNs' | 'uid=John C. Smith,ou=People,dc=example,dc=com' | true
......@@ -110,7 +110,7 @@ describe Gitlab::LDAP::Person do
with_them do
it 'returns the expected boolean' do
assert_generic_test(test_description, described_class.is_dn?(given), expected)
assert_generic_test(test_description, described_class.dn?(given), expected)
end
end
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment