Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Enforce String type to #plain argument #92

Merged
merged 1 commit into from
Oct 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading