-
Notifications
You must be signed in to change notification settings - Fork 517
run more than one command inside run #168
Comments
Creating a front end script for the function that runs both functions would solve this. |
@bcv Please use markdown's formatting abilities, especially code blocks, to improve readability of your posts. Functions depending on side-effectsIf all you want to do is test a function that relies on side-effects of others, simply call the functions causing the side-effects first and then #!/usr/bin/env bats
increment_var() {
(( ++VAR ))
}
print_var() {
echo "$VAR"
}
@test 'Testing function that depends on side-effects' {
increment_var # VAR = 1
increment_var # VAR = 2
run print_var
[ "$output" == '2' ]
}
Passing more than one command to
|
Hi,
This might be a silly question but in my case I have a persistent variable in a function and so
want to call this function twice
run (func1 arg1 ; func2 arg2 )
doesnt seem to be welcomed by BATS
The text was updated successfully, but these errors were encountered: