Skip to content

Commit

Permalink
tests: ensure that "garden -D variable='${expression}'" evaluates the…
Browse files Browse the repository at this point in the history
… expression
  • Loading branch information
davvid committed Feb 10, 2024
1 parent 51180e7 commit 71dacb4
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ fn eval_garden_root() {
);
}

/// `garden eval` evaluates ${GARDEN_CONFIG_DIR}
/// `garden eval` evaluates overridden variables.
#[test]
fn eval_override_variables() {
// garden eval ${tree_variable} current
Expand All @@ -624,8 +624,22 @@ fn eval_override_variables() {
"current",
]);
assert_eq!(output, "test");
}

Ok(())
/// `garden -D value=expression` evaluates the expression.
#[test]
fn eval_override_expressions() {
// garden -D value='${tree_value}' eval '${value}' current
let output = garden_capture(&[
"--config",
"tests/data/garden.yaml",
"--define",
"value=${tree_value}",
"eval",
"${value}",
"current",
]);
assert_eq!(output, "tree");
}

/// `garden eval` evaluates ${GARDEN_ROOT} to the same directory as the
Expand Down

0 comments on commit 71dacb4

Please sign in to comment.