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:
21
test/__stub_call-test.sh
Executable file
21
test/__stub_call-test.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#! /usr/bin/env bash
|
||||
source "test-helper.sh"
|
||||
|
||||
#
|
||||
# __stub_call() tests.
|
||||
#
|
||||
|
||||
# Adds call to stub call list.
|
||||
STUB_INDEX=("uname=0")
|
||||
STUB_0_CALLS=()
|
||||
__stub_call "uname"
|
||||
__stub_call "uname" -r
|
||||
__stub_call "uname" -r -a
|
||||
assert 'echo ${STUB_0_CALLS[@]}' "<none> -r -r -a"
|
||||
assert 'echo ${STUB_0_CALLS[0]}' "<none>"
|
||||
assert 'echo ${STUB_0_CALLS[1]}' "-r"
|
||||
assert 'echo ${STUB_0_CALLS[2]}' "-r -a"
|
||||
|
||||
|
||||
# End of tests.
|
||||
assert_end "__stub_call()"
|
||||
Reference in New Issue
Block a user