From 0dfe812adbc4aace7f815c82396218bcd9cd57dc Mon Sep 17 00:00:00 2001 From: Marcel Otto Date: Fri, 8 Apr 2022 12:38:01 +0200 Subject: [PATCH] Fix CI --- test/unit/graph_builder_test.exs | 36 +++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/test/unit/graph_builder_test.exs b/test/unit/graph_builder_test.exs index f115884..ac1573d 100644 --- a/test/unit/graph_builder_test.exs +++ b/test/unit/graph_builder_test.exs @@ -368,17 +368,33 @@ defmodule RDF.Graph.BuilderTest do end test "require" do - {graph, log} = - with_log(fn -> - RDF.Graph.build do - require Logger - Logger.info("logged successfully") - EX.S |> EX.p(EX.O) - end - end) + if Version.match?(System.version(), ">= 1.13.0") do + {graph, log} = + with_log(fn -> + RDF.Graph.build do + require Logger + Logger.info("logged successfully") + EX.S |> EX.p(EX.O) + end + end) - assert graph == RDF.graph(EX.S |> EX.p(EX.O)) - assert log =~ "logged successfully" + assert graph == RDF.graph(EX.S |> EX.p(EX.O)) + assert log =~ "logged successfully" + else + log = + capture_log(fn -> + graph = + RDF.Graph.build do + require Logger + Logger.info("logged successfully") + EX.S |> EX.p(EX.O) + end + + assert graph == RDF.graph(EX.S |> EX.p(EX.O)) + end) + + assert log =~ "logged successfully" + end end test "use" do