rdf-ex/test/unit/sigils_test.exs

30 lines
683 B
Elixir
Raw Normal View History

2017-04-10 00:38:30 +00:00
defmodule RDF.SigilsTest do
use ExUnit.Case, async: true
import RDF.Sigils
doctest RDF.Sigils
describe "IRI sigil without interpolation" do
test "creating an IRI" do
assert ~I<http://example.com> == RDF.iri("http://example.com")
2017-04-10 00:38:30 +00:00
end
2017-04-18 01:27:28 +00:00
end
2017-04-10 00:38:30 +00:00
2017-05-19 15:19:06 +00:00
describe "Blank node sigil without interpolation" do
test "creating a blank node" do
assert ~B<foo> == RDF.bnode("foo")
end
end
2017-04-18 01:27:28 +00:00
describe "Literal sigil without interpolation" do
test "creating a plain Literal" do
assert ~L"foo" == RDF.literal("foo")
end
test "creating a language-tagged Literal" do
assert ~L"foo"en == RDF.literal("foo", language: "en")
end
2017-04-10 00:38:30 +00:00
end
end