mirror of
https://github.com/jimeh/stub.sh.git
synced 2026-02-19 13:46:40 +00:00
Add stub_called_with and related functions
This commit is contained in:
22
test/__stub_register-test.sh
Executable file
22
test/__stub_register-test.sh
Executable file
@@ -0,0 +1,22 @@
|
||||
#! /usr/bin/env bash
|
||||
source "test-helper.sh"
|
||||
|
||||
#
|
||||
# __stub_register() tests.
|
||||
#
|
||||
|
||||
# Sets up stub index, stub call list, and adds stub to index.
|
||||
__stub_register "uname"
|
||||
__stub_register "top"
|
||||
assert 'echo ${STUB_INDEX[@]}' 'uname=0 top=1'
|
||||
assert 'echo ${STUB_INDEX[0]}' 'uname=0'
|
||||
assert 'echo ${STUB_INDEX[1]}' 'top=1'
|
||||
assert 'echo $STUB_NEXT_INDEX' "2"
|
||||
|
||||
# Note: There seems to be no possible way to validate if a empty array
|
||||
# variable has been set, as it appears to be empty/null/undefined whatever I
|
||||
# try.
|
||||
|
||||
|
||||
# End of tests.
|
||||
assert_end "__stub_register()"
|
||||
Reference in New Issue
Block a user