rspec tests

This commit is contained in:
Christian Mehlmauer
2012-09-21 19:05:14 +02:00
parent 159741604e
commit a113829798
3 changed files with 164 additions and 1 deletions

View File

@@ -66,7 +66,7 @@ def get_equal_string_end(stringarray = [""])
break
end
end
if looping == false or (counter * -1 ) >= base.length
if looping == false or (counter * -1 ) > base.length
break
end
already_found = "#{character if character}#{already_found}"

View File

@@ -79,8 +79,14 @@ module WpUsernames
end
def remove_junk_from_nickname(usernames)
unless usernames.kind_of? Array
raise("Need an array as input")
end
nicknames = []
usernames.each do |u|
unless u.kind_of? WpUser
raise("Items must be of type WpUser")
end
nickname = u.nickname
unless nickname == "empty"
nicknames << nickname