Skip to content

Commit

Permalink
Chomp newline in sass tests
Browse files Browse the repository at this point in the history
In my environment these fail due to render returning a string ending
with a newline.  Since the newline doesn't cause any problems in
CSS, I don't think we should force remove it in the template engine.
It seems acceptable to allow output both with and without a newline.
  • Loading branch information
jeremyevans authored and judofyr committed Aug 4, 2022
1 parent a38c7a1 commit 0de713d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/tilt_sasstemplate_test.rb
Expand Up @@ -10,12 +10,12 @@ class SassTemplateTest < Minitest::Test

test "compiles and evaluates the template on #render" do
template = Tilt::SassTemplate.new({ style: :compressed }) { |t| "#main\n background-color: #0000f1" }
assert_equal "#main{background-color:#0000f1}", template.render
assert_equal "#main{background-color:#0000f1}", template.render.chomp
end

test "can be rendered more than once" do
template = Tilt::SassTemplate.new({ style: :compressed }) { |t| "#main\n background-color: #0000f1" }
3.times { assert_equal "#main{background-color:#0000f1}", template.render }
3.times { assert_equal "#main{background-color:#0000f1}", template.render.chomp }
end
end

Expand All @@ -26,12 +26,12 @@ class ScssTemplateTest < Minitest::Test

test "compiles and evaluates the template on #render" do
template = Tilt::ScssTemplate.new({ style: :compressed }) { |t| "#main {\n background-color: #0000f1;\n}" }
assert_equal "#main{background-color:#0000f1}", template.render
assert_equal "#main{background-color:#0000f1}", template.render.chomp
end

test "can be rendered more than once" do
template = Tilt::ScssTemplate.new({ style: :compressed }) { |t| "#main {\n background-color: #0000f1;\n}" }
3.times { assert_equal "#main{background-color:#0000f1}", template.render }
3.times { assert_equal "#main{background-color:#0000f1}", template.render.chomp }
end
end

Expand Down

0 comments on commit 0de713d

Please sign in to comment.