From ddb3d365bce869a77793b479a51cf8d03eb0dc4b Mon Sep 17 00:00:00 2001 From: Marcel Otto Date: Sun, 1 Nov 2020 02:25:25 +0100 Subject: [PATCH] Add tests for RDF.BlankNode.new/1 --- test/unit/blank_node_test.exs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 test/unit/blank_node_test.exs diff --git a/test/unit/blank_node_test.exs b/test/unit/blank_node_test.exs new file mode 100644 index 0000000..71f13b3 --- /dev/null +++ b/test/unit/blank_node_test.exs @@ -0,0 +1,26 @@ +defmodule RDF.BlankNodeTest do + use RDF.Test.Case + + doctest RDF.BlankNode + + alias RDF.BlankNode + + describe "new/1" do + test "with a string" do + assert BlankNode.new("foo") == %BlankNode{value: "foo"} + end + + test "with an atom" do + assert BlankNode.new(:foo) == %BlankNode{value: "foo"} + end + + test "with a integer" do + assert BlankNode.new(42) == %BlankNode{value: "42"} + end + + test "with a ref" do + assert %BlankNode{value: value} = BlankNode.new(make_ref()) + assert is_binary(value) + end + end +end