From 3d7eb0d7350f70b575220783e17b0143430f04d6 Mon Sep 17 00:00:00 2001 From: Steffen Winterfeldt Date: Thu, 17 Feb 2022 10:27:44 +0100 Subject: [PATCH] adjust unit tests --- library/xml/test/xml_test.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/library/xml/test/xml_test.rb b/library/xml/test/xml_test.rb index 71bdc7f67..4f239d611 100644 --- a/library/xml/test/xml_test.rb +++ b/library/xml/test/xml_test.rb @@ -86,13 +86,13 @@ expect(subject.YCPToXMLString("test", input)).to eq expected end - it "creates no CDATA element if string starts with spaces" do + it "creates CDATA element if string starts with spaces" do input = { "test" => " test", "lest" => "\nlest" } expected = "\n" \ "\n" \ "\n" \ - " \nlest\n" \ - " test\n" \ + " \n" \ + " \n" \ "\n" expect(subject.YCPToXMLString("test", input)).to eq expected @@ -343,13 +343,13 @@ expect(subject.XMLToYCPString(input)).to eq expected end - it "strips spaces at the start of CDATA elements" do + it "preserves spaces at the start of CDATA elements" do input = "\n" \ "\n" \ " \n" \ " \n" \ "\n" - expected = { "test" => "foo", "lest" => "bar" } + expected = { "test" => " foo", "lest" => "\nbar" } expect(subject.XMLToYCPString(input)).to eq expected end