:ugly mode shouldn't mess with filter input.

This commit is contained in:
Nathan Weizenbaum 2008-07-10 23:38:39 -04:00
parent 07ffc82ee4
commit 82a2571e68
2 changed files with 10 additions and 7 deletions

View File

@ -303,13 +303,9 @@ END
# Adds +text+ to <tt>@buffer</tt> while flattening text.
def push_flat(line)
unless @options[:ugly]
tabulation = line.spaces - @flat_spaces
tabulation = tabulation > -1 ? tabulation : 0
@filter_buffer << "#{' ' * tabulation}#{line.unstripped}\n"
else
@filter_buffer << "#{line.unstripped}\n"
end
tabulation = line.spaces - @flat_spaces
tabulation = tabulation > -1 ? tabulation : 0
@filter_buffer << "#{' ' * tabulation}#{line.unstripped}\n"
end
# Causes <tt>text</tt> to be evaluated in the context of

View File

@ -477,6 +477,13 @@ SOURCE
END
end
def test_ugly_filter
assert_equal(<<END, render(":sass\n #foo\n bar: baz", :ugly => true))
#foo {
bar: baz; }
END
end
def test_local_assigns_dont_modify_class
assert_equal("bar\n", render("= foo", :locals => {:foo => 'bar'}))
assert_equal(nil, defined?(foo))