mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
Multiple calls to Sass::Engine#render shouldn't accumulate results
Additionally: removed the "@line = nil" from #render_to_tree since it seems better suited inside #split_lines (where it's already present). Signed-off-by: Nathan Weizenbaum <nex342@gmail.com>
This commit is contained in:
parent
f3ac053f9c
commit
51e7035868
2 changed files with 6 additions and 1 deletions
2
lib/sass/engine.rb
Normal file → Executable file
2
lib/sass/engine.rb
Normal file → Executable file
|
@ -113,7 +113,7 @@ module Sass
|
|||
end
|
||||
end
|
||||
end
|
||||
@line = nil
|
||||
@lines.clear
|
||||
|
||||
root
|
||||
end
|
||||
|
|
5
test/sass/engine_test.rb
Normal file → Executable file
5
test/sass/engine_test.rb
Normal file → Executable file
|
@ -52,6 +52,11 @@ class SassEngineTest < Test::Unit::TestCase
|
|||
renders_correctly "basic", { :style => :compact }
|
||||
end
|
||||
|
||||
def test_multiple_calls_to_render
|
||||
sass = Sass::Engine.new("a\n b: c")
|
||||
assert_equal sass.render, sass.render
|
||||
end
|
||||
|
||||
def test_alternate_styles
|
||||
renders_correctly "expanded", { :style => :expanded }
|
||||
renders_correctly "compact", { :style => :compact }
|
||||
|
|
Loading…
Add table
Reference in a new issue