Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Failing test for #87

  • Loading branch information...
commit 0f89d738940cce3dd24b6137fe94d2d7528fd59e 1 parent ee6c868
@defunkt defunkt authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 test/mustache_test.rb
7 test/mustache_test.rb
@@ -74,6 +74,13 @@ def test_sassy_single_line_sections
assert_equal "\n full time\n", instance.render
+ def test_sassier_single_line_sections
+ instance =
+ instance.template = "\t{{#list}}\r\n\t{{/list}}"
+ assert_equal "", instance.render
+ end
def test_two_line_sections
html = %(<p class="flash-notice" {{# no_flash }}style="display: none;"\n{{/ no_flash }}>)

3 comments on commit 0f89d73


Is this expected behaviour?

m =
m.template = " {{#list}} \nHello{{/list}}"
p m.render(:list => [1, 2])
# => "  \nHello  \nHello"


  [:mustache, :fetch, ["list"]],
  [:multi, [:static, " "], [:static, " \nHello"]],
  " \nHello"]]

I would expect that the whitespace before the opening tag should not be a part of the section, but rather be inserted before the section tag.


I've pushed a fix for this test and a fix/test for the comment above. All tests pass (including the Mustache specs). I'll leave #87 open until you decide if this is the right solution.


This is not the first bug of this class that we've seen; I'll push some new tests into the spec so that future implementations don't hit the same potholes.

Please sign in to comment.
Something went wrong with that request. Please try again.