test/custom_render_test.rb in redcarpet-3.4.0 vs test/custom_render_test.rb in redcarpet-3.5.0
- old
+ new
@@ -34,9 +34,19 @@
output = parser.render("*foo*")
assert_match "no_intra_emphasis", output
end
+ def test_original_options_hash_is_not_mutated
+ options = { with_toc_data: true }
+ render = SimpleRender.new(options)
+ parser = Redcarpet::Markdown.new(render, tables: true)
+
+ computed_options = render.instance_variable_get(:"@options")
+
+ refute_equal computed_options.object_id, options.object_id
+ end
+
class NilPreprocessRenderer < Redcarpet::Render::HTML
def preprocess(fulldoc)
nil
end
end