Skip to content

Latest commit

 

History

History
24 lines (17 loc) · 524 Bytes

04_setting_env_variables.md

File metadata and controls

24 lines (17 loc) · 524 Bytes

Setting env variables

env steps can be used to set env variables. Each non-empty row of the env code block is passed to env of future test steps.

# Test for empty string
test -z "$example_var"

The above test will fail because $example_var is not set (or it is empty). Let's defined it in a env block.

example_var=Example value

another_var=Another value

The variable is now defined in following test steps.

# Test for non-empty string
test -n "$example_var"
test -n "$another_var"