From e26035279226ee8a8a06139408aae2ea7878f063 Mon Sep 17 00:00:00 2001 From: "Brian J. Cardiff" Date: Sat, 30 Jan 2021 09:02:13 -0300 Subject: [PATCH] XML: fix deprecation warning (#10335) --- spec/std/xml/xpath_spec.cr | 5 +++++ src/xml/node_set.cr | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/spec/std/xml/xpath_spec.cr b/spec/std/xml/xpath_spec.cr index 9f243cf9f2ee..0675d4c708d2 100644 --- a/spec/std/xml/xpath_spec.cr +++ b/spec/std/xml/xpath_spec.cr @@ -206,5 +206,10 @@ module XML result = doc.xpath_string("string(//feed/person[@id=$value]/@id)", variables: {"value" => 2}) result.should eq("2") end + + it "NodeSet#to_s" do + doc = doc() + doc.xpath("//people/person").to_s + end end end diff --git a/src/xml/node_set.cr b/src/xml/node_set.cr index 541a440d1f09..33b7afbf2d8a 100644 --- a/src/xml/node_set.cr +++ b/src/xml/node_set.cr @@ -46,7 +46,7 @@ struct XML::NodeSet end def to_s(io : IO) : Nil - join '\n', io + join io, '\n' end def to_unsafe