Skip to content

Commit

Permalink
refactor: Enforce String type to #plain argument
Browse files Browse the repository at this point in the history
  • Loading branch information
stephannv committed Oct 20, 2024
1 parent 9f14e13 commit 9598c46
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
8 changes: 0 additions & 8 deletions spec/blueprint/html/utils_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ private class ExamplePage
b "World"
end

plain MarkdownLink.new("Blueprint", "blueprint.example.com")

i "Hi"
whitespace
plain "User"
Expand All @@ -32,12 +30,6 @@ describe "utils" do

page.to_s.should contain("<div>Hello<b>World</b></div>")
end

it "accepts any objects that respond `#to_s`" do
page = ExamplePage.new

page.to_s.should contain("[Blueprint](blueprint.example.com)")
end
end

describe "#doctype" do
Expand Down
2 changes: 1 addition & 1 deletion src/blueprint/html/utils.cr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Blueprint::HTML::Utils
private def plain(content) : Nil
private def plain(content : String) : Nil
append_to_buffer(content)
end

Expand Down

0 comments on commit 9598c46

Please sign in to comment.