Utils tests
This commit is contained in:
parent
f4dd5d70d7
commit
72cd90cef3
1 changed files with 23 additions and 0 deletions
23
test/dsl/utils_test.exs
Normal file
23
test/dsl/utils_test.exs
Normal file
|
@ -0,0 +1,23 @@
|
|||
defmodule Dsl.UtilsTest do
|
||||
use ExUnit.Case, async: true
|
||||
|
||||
describe "from_safe/1" do
|
||||
test "returns a the text from a safe partial" do
|
||||
expected = "I am safe!"
|
||||
partial = {:safe, expected}
|
||||
|
||||
result = Dsl.Utils.from_safe(partial)
|
||||
|
||||
assert result == expected
|
||||
end
|
||||
|
||||
test "escapes an unsafe partial and returns the text" do
|
||||
expected = "I am <safe>!"
|
||||
partial = "I am <safe>!"
|
||||
|
||||
result = Dsl.Utils.from_safe(partial)
|
||||
|
||||
assert result == expected
|
||||
end
|
||||
end
|
||||
end
|
Reference in a new issue