rdf-ex/test/unit/guards_test.exs
2020-05-06 18:04:19 +02:00

26 lines
469 B
Elixir

defmodule RDF.GuardsTest do
use RDF.Test.Case
doctest RDF.Guards
import RDF.Guards
describe "maybe_ns_term/1" do
def test_fun(term) when maybe_ns_term(term), do: true
def test_fun(_), do: false
test "with booleans" do
refute test_fun(true)
refute test_fun(false)
end
test "with nil" do
refute test_fun(nil)
end
test "any other atom" do
assert test_fun(:foo)
assert test_fun(Foo)
end
end
end