Commit fee3c95d authored by Michael Kozono's avatar Michael Kozono

Remove redundant `is_`

parent 3e83ba34
...@@ -38,7 +38,7 @@ module Gitlab ...@@ -38,7 +38,7 @@ module Gitlab
# Returns the UID or DN in a normalized form # Returns the UID or DN in a normalized form
def self.normalize_uid_or_dn(uid_or_dn) 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) normalize_dn(uid_or_dn)
else else
normalize_uid(uid_or_dn) normalize_uid(uid_or_dn)
...@@ -49,7 +49,7 @@ module Gitlab ...@@ -49,7 +49,7 @@ module Gitlab
# #
# An empty string is technically a valid DN (null DN), although we should # An empty string is technically a valid DN (null DN), although we should
# never need to worry about that. # 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?('=') uid_or_dn.blank? || uid_or_dn.include?('=')
end end
......
...@@ -96,7 +96,7 @@ describe Gitlab::LDAP::Person do ...@@ -96,7 +96,7 @@ describe Gitlab::LDAP::Person do
it_behaves_like 'normalizes the DN' it_behaves_like 'normalizes the DN'
end end
describe '.is_dn?' do describe '.dn?' do
where(:test_description, :given, :expected) do where(:test_description, :given, :expected) do
'given a DN with a single RDN' | 'uid=John C. Smith' | true '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 '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 ...@@ -110,7 +110,7 @@ describe Gitlab::LDAP::Person do
with_them do with_them do
it 'returns the expected boolean' 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 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