Skip to content

Commit fce7b73

Browse files
committed
Merge pull request #33 from fschwahn/add_tests_for_empty_templates
Add more tests for empty templates
2 parents abdf79a + 91ded2b commit fce7b73

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/engine_test.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,5 +194,17 @@ def test_empty_template
194194
output = Engine.new('').render
195195
assert_equal '', output
196196
end
197+
198+
def test_empty_template_returns_a_new_object
199+
input = ''
200+
output = Engine.new(input).render
201+
assert input.object_id != output.object_id, 'empty template must return a new object'
202+
end
203+
204+
def test_empty_template_encoding_matches_input
205+
input = ''.force_encoding("ISO-8859-1")
206+
output = Engine.new(input).render
207+
assert_equal input.encoding, output.encoding
208+
end
197209
end
198210
end

0 commit comments

Comments
 (0)