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:
Roman Le Négrate 2008-03-27 14:29:48 +01:00 committed by Nathan Weizenbaum
parent f3ac053f9c
commit 51e7035868
2 changed files with 6 additions and 1 deletions

2
lib/sass/engine.rb Normal file → Executable file
View 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
View 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 }