-
-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f427459
commit c30588c
Showing
3 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
load ../bats_setup | ||
load ../bats_zencode | ||
SUBDOC=and | ||
|
||
@test "And inside foreach" { | ||
cat <<EOF | save_asset andforeach.data | ||
{ | ||
"to_be_hashed": [ | ||
"a", | ||
"b", | ||
"john", | ||
12345, | ||
"[email protected]", | ||
"(!)" | ||
] | ||
} | ||
EOF | ||
cat <<EOF | zexe andforeach.zen andforeach.data | ||
Given I have a 'string array' named 'to_be_hashed' | ||
When I create the 'base64 array' named 'array of hashes' | ||
Foreach 'element_to_be_hashed' in 'to_be_hashed' | ||
When I create the hash of 'element_to_be_hashed' | ||
and I move 'hash' in 'array of hashes' | ||
EndForeach | ||
Then print 'array of hashes' | ||
EOF | ||
save_output "andforeach.json" | ||
assert_output '{"array_of_hashes":["ypeBEsobvcr6wjGzmiPcTaeG7/gUfE5yuYB3ha/uSLs=","PiPoFgA5WUoziU9lZOGxNIu9egCI1CxKy3PurtWcAJ0=","ltljLzY1ZMwwMlIUCc8iqFLyAy7sCZ7VlnwNAAzsYHo=","WZRHGrsBESr8wYFZ9sx0tPURuZgG2lmzyvWpwXPKz8U=","1wnzcOUrV7TrdfBOKzQixNQaBRSMrY+Bd22UoEj7cK8=","CVh+6HMogNKneQFF+XSaFy0nJ80KKduyZRbky5xVGKg="]}' | ||
} | ||
|