Refactor the test for SafeString.
This commit is contained in:
@@ -7,11 +7,10 @@ defmodule LinkShortener.Generators.SafeStringTest do
|
|||||||
|
|
||||||
test "generate/1 returns random safe string with same length" do
|
test "generate/1 returns random safe string with same length" do
|
||||||
for expected_length <- @lengths do
|
for expected_length <- @lengths do
|
||||||
length = expected_length
|
assert ^expected_length =
|
||||||
|
expected_length
|
||||||
|> SafeString.generate()
|
|> SafeString.generate()
|
||||||
|> String.length()
|
|> String.length()
|
||||||
|
|
||||||
assert length = expected_length
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user