21 lines
509 B
Bash
Executable File
21 lines
509 B
Bash
Executable File
it "Should parse cookies" "$({
|
|
HTTP_COOKIE='bob=gob; job=tob'
|
|
_exprashInit
|
|
output=$(declare -p _exprashCookies)
|
|
expected_output='declare -A _exprashCookies=([bob]="gob" [job]="tob" )'
|
|
[ "$output" == "$expected_output" ]
|
|
})"
|
|
|
|
it "Should get cookie value by name" "$({
|
|
HTTP_COOKIE='bob=gob; job=tob'
|
|
_exprashInit
|
|
[ "$(cookie 'bob')" == 'gob' ]
|
|
})"
|
|
|
|
it "Should determine if a cookie exists by name" "$({
|
|
HTTP_COOKIE='bob=gob; job=tob'
|
|
_exprashInit
|
|
hasCookie 'bob' && ! hasCookie 'kob'
|
|
})"
|
|
|