From ea82b989c806204edc78ac2e842ca988699699f7 Mon Sep 17 00:00:00 2001 From: stephann <3025661+stephannv@users.noreply.github.com> Date: Fri, 13 Sep 2024 18:31:29 -0300 Subject: [PATCH] fix: Remove some utils methods (plain(&), comment(&), unsafe_raw(&) (#69) --- spec/blueprint/html/safety_spec.cr | 16 +++----------- spec/blueprint/html/utils_spec.cr | 34 ++++++------------------------ src/blueprint/html/utils.cr | 18 +++------------- 3 files changed, 13 insertions(+), 55 deletions(-) diff --git a/spec/blueprint/html/safety_spec.cr b/spec/blueprint/html/safety_spec.cr index 32f0372..1542772 100644 --- a/spec/blueprint/html/safety_spec.cr +++ b/spec/blueprint/html/safety_spec.cr @@ -11,8 +11,7 @@ private class Example plain "" render(ExampleComponent.new) { "" } div(class: "some-class\" onblur=\"alert('Attribute')") - comment { "--> - HTML - - page.to_s.should contain(expected_html) - end - - it "escapes comment content passed via argument" do - page = Example.new - expected_html = normalize_html <<-HTML - + HTML page.to_s.should contain(expected_html) diff --git a/spec/blueprint/html/utils_spec.cr b/spec/blueprint/html/utils_spec.cr index 0bdb675..910b2b2 100644 --- a/spec/blueprint/html/utils_spec.cr +++ b/spec/blueprint/html/utils_spec.cr @@ -10,33 +10,25 @@ private class ExamplePage b "World" end - span { plain { "Plain!" } } - i "Hi" whitespace plain "User" - comment { "This is an html comment" } - comment "This is another html comment" + comment "This is an html comment" - unsafe_raw "" - div { unsafe_raw { "" } } + div do + unsafe_raw "" + end end end describe "utils" do describe "#plain" do - it "renders plain text passed via argument" do + it "renders plain text" do page = ExamplePage.new page.to_s.should contain("