Skip to content

Commit ac003ab

Browse files
committed
Merge pull request #31 from fschwahn/allow_empty_template
Don't raise error when template is empty
2 parents f7ff6bc + c586f05 commit ac003ab

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

lib/sassc/engine.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ def initialize(template, options = {})
1717
end
1818

1919
def render
20+
return @template if @template.empty?
21+
2022
data_context = Native.make_data_context(@template)
2123
context = Native.data_context_get_context(data_context)
2224
native_options = Native.context_get_options(context)

test/engine_test.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,5 +189,10 @@ def test_inline_source_maps
189189
assert_match /sourceMappingURL/, output
190190
assert_match /.foo/, output
191191
end
192+
193+
def test_empty_template
194+
output = Engine.new('').render
195+
assert_equal '', output
196+
end
192197
end
193198
end

0 commit comments

Comments
 (0)