* Ensured all tests use at least the DataCase module * addressed one flakey test * More flakey tests * Consolidated Mox usage
17 lines
392 B
Elixir
17 lines
392 B
Elixir
defmodule Pinchflat.Utils.XmlUtilsTest do
|
|
use Pinchflat.DataCase
|
|
|
|
alias Pinchflat.Utils.XmlUtils
|
|
|
|
describe "safe/1" do
|
|
test "escapes invalid characters" do
|
|
assert XmlUtils.safe("hello' & <world>") == "hello' & <world>"
|
|
end
|
|
|
|
test "converts input to string" do
|
|
assert XmlUtils.safe(42) == "42"
|
|
assert XmlUtils.safe(nil) == ""
|
|
end
|
|
end
|
|
end
|