From 79e66dfa8eaa1a97c732f9f6b8700a6c3321b6e6 Mon Sep 17 00:00:00 2001 From: Matt Wildig Date: Sat, 29 Nov 2014 01:49:32 +0000 Subject: [PATCH] Replace original ERB filter options after test This is just a precaution, it isn't causing any issues at the moment. --- test/filters_test.rb | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/test/filters_test.rb b/test/filters_test.rb index e8338bfb..e5b04e45 100644 --- a/test/filters_test.rb +++ b/test/filters_test.rb @@ -79,10 +79,15 @@ class FiltersTest < Haml::TestCase end test "should pass options to Tilt filters that precompile" do - haml = ":erb\n <%= 'foo' %>" - refute_match('test_var', Haml::Engine.new(haml).compiler.precompiled) - Haml::Filters::Erb.options = {:outvar => 'test_var'} - assert_match('test_var', Haml::Engine.new(haml).compiler.precompiled) + begin + orig_erb_opts = Haml::Filters::Erb.options + haml = ":erb\n <%= 'foo' %>" + refute_match('test_var', Haml::Engine.new(haml).compiler.precompiled) + Haml::Filters::Erb.options = {:outvar => 'test_var'} + assert_match('test_var', Haml::Engine.new(haml).compiler.precompiled) + ensure + Haml::Filters::Erb.options = orig_erb_opts + end end test "should pass options to Tilt filters that don't precompile" do