Add emulation of top-level RDF module as RDF.Namespace

This commit is contained in:
Marcel Otto 2022-06-06 20:07:12 +02:00
parent 78ff120732
commit adf3905ee6
2 changed files with 7 additions and 0 deletions

View file

@ -340,4 +340,7 @@ defmodule RDF do
defdelegate unquote(nil)(), to: RDF.NS.RDF
defdelegate __base_iri__(), to: RDF.NS.RDF
defdelegate __terms__(), to: RDF.NS.RDF
defdelegate __iris__(), to: RDF.NS.RDF
defdelegate __resolve_term__(term), to: RDF.NS.RDF
end

View file

@ -106,6 +106,10 @@ defmodule RDF.NamespaceTest do
assert RDF.Namespace.namespace?(RDF.NS.XSD) == true
end
test "with the top-level RDF module" do
assert RDF.Namespace.namespace?(RDF) == true
end
test "with non-RDF.Namespace modules" do
assert RDF.Namespace.namespace?(Enum) == false
assert RDF.Namespace.namespace?(__MODULE__) == false