1
0
Fork 0
mirror of https://github.com/nishiki/manage-password.git synced 2025-02-20 01:50:04 +00:00

add test cli for genpwd

This commit is contained in:
Adrien Waksberg 2017-05-20 11:31:37 +02:00
parent 3b9ff8c15c
commit 01831c1f2b

View file

@ -197,4 +197,29 @@ class TestConfig < Test::Unit::TestCase
assert_match(/password_#{k}.+\| true/, output)
end
end
def test_07_generate_password
length = 24
output = %x(
mpw genpwd \
--length #{length} \
--alpha
)
assert_match(/[a-zA-Z]{#{length}}/, output)
output = %x(
mpw genpwd \
--length #{length} \
--numeric
)
assert_match(/[0-9]{#{length}}/, output)
output = %x(
mpw genpwd \
--length #{length} \
--special-chars
)
assert_no_match(/[a-zA-Z0-9]/, output)
end
end