Hello, I was trying to refactor my recipes recently, and I find it very hard to do without worrying if they still work as expected. So I figured that it would be great to be able to test the recipes, using bats https://github.com/bats-core/bats-core, by running just --dry-run <recipe> and checking comparing it against expected output, to verify that the actual command that is run didn't change despite changes in the recipes structure.
Problem is that if I want to delegate some logic common to multiple recipes to some shared recipe that could be reused, when I use recipe inside the other recipe, the --dry-run does not echo the content of nested recipe, instead it just echoes the just call as it is, which pretty much negates viability of this approach.
So, how I imagine it could work, for examplary jusffile:
some_recipe param:
echo "call1 {{param}}"
some_recipe2 param:
just some_recipe {{param}}
echo "call2 {{param}}"
state right now:
> just --dry-run some_recipe2 foo
just some_recipe foo
echo "call2 foo"
How I would like it to work:
> just --dry-run-recursive some_recipe2 foo
echo "call1 foo"
echo "call2 foo"
Hello, I was trying to refactor my recipes recently, and I find it very hard to do without worrying if they still work as expected. So I figured that it would be great to be able to test the recipes, using
batshttps://github.com/bats-core/bats-core, by runningjust --dry-run <recipe>and checking comparing it against expected output, to verify that the actual command that is run didn't change despite changes in the recipes structure.Problem is that if I want to delegate some logic common to multiple recipes to some shared recipe that could be reused, when I use recipe inside the other recipe, the
--dry-rundoes not echo the content of nested recipe, instead it just echoes thejustcall as it is, which pretty much negates viability of this approach.So, how I imagine it could work, for examplary jusffile:
state right now:
How I would like it to work: