From 2ae161b4bd4ff2f3e0d06c716c9cbfbd1a4e342a Mon Sep 17 00:00:00 2001 From: pantor Date: Fri, 23 Feb 2018 23:47:09 +0100 Subject: [PATCH] make renderer private in env --- src/inja.hpp | 4 +--- test/src/unit-renderer.cpp | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/inja.hpp b/src/inja.hpp index d2c9e24..f3c3ee1 100644 --- a/src/inja.hpp +++ b/src/inja.hpp @@ -865,11 +865,9 @@ class Environment { const std::string output_path; Parser parser = Parser(); - -public: Renderer renderer = Renderer(); - +public: Environment(): Environment("./") { } explicit Environment(const std::string& global_path): input_path(global_path), output_path(global_path), parser() { } explicit Environment(const std::string& input_path, const std::string& output_path): input_path(input_path), output_path(output_path), parser() { } diff --git a/test/src/unit-renderer.cpp b/test/src/unit-renderer.cpp index a97ebf9..68a69d5 100644 --- a/test/src/unit-renderer.cpp +++ b/test/src/unit-renderer.cpp @@ -241,11 +241,11 @@ TEST_CASE("templates") { data["city"] = "Brunswick"; data["is_happy"] = true; - CHECK( env.renderer.render(temp, data) == "Peter" ); + CHECK( env.render_template(temp, data) == "Peter" ); data["is_happy"] = false; - CHECK( env.renderer.render(temp, data) == "Brunswick" ); + CHECK( env.render_template(temp, data) == "Brunswick" ); } TEST_CASE("other-syntax") {