mirror of
https://github.com/pantor/inja.git
synced 2026-09-01 03:47:13 +00:00
make renderer private in env
This commit is contained in:
+1
-3
@@ -865,11 +865,9 @@ class Environment {
|
|||||||
const std::string output_path;
|
const std::string output_path;
|
||||||
|
|
||||||
Parser parser = Parser();
|
Parser parser = Parser();
|
||||||
|
|
||||||
public:
|
|
||||||
Renderer renderer = Renderer();
|
Renderer renderer = Renderer();
|
||||||
|
|
||||||
|
public:
|
||||||
Environment(): Environment("./") { }
|
Environment(): Environment("./") { }
|
||||||
explicit Environment(const std::string& global_path): input_path(global_path), output_path(global_path), parser() { }
|
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() { }
|
explicit Environment(const std::string& input_path, const std::string& output_path): input_path(input_path), output_path(output_path), parser() { }
|
||||||
|
|||||||
@@ -241,11 +241,11 @@ TEST_CASE("templates") {
|
|||||||
data["city"] = "Brunswick";
|
data["city"] = "Brunswick";
|
||||||
data["is_happy"] = true;
|
data["is_happy"] = true;
|
||||||
|
|
||||||
CHECK( env.renderer.render(temp, data) == "Peter" );
|
CHECK( env.render_template(temp, data) == "Peter" );
|
||||||
|
|
||||||
data["is_happy"] = false;
|
data["is_happy"] = false;
|
||||||
|
|
||||||
CHECK( env.renderer.render(temp, data) == "Brunswick" );
|
CHECK( env.render_template(temp, data) == "Brunswick" );
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("other-syntax") {
|
TEST_CASE("other-syntax") {
|
||||||
|
|||||||
Reference in New Issue
Block a user