mirror of
https://github.com/jimeh/stub.sh.git
synced 2026-02-19 13:46:40 +00:00
Use test-runner.sh instead of homegrown test.sh
This commit is contained in:
21
test/__stub_index.test.sh
Executable file
21
test/__stub_index.test.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#! /usr/bin/env bash
|
||||
source "test-helper.sh"
|
||||
|
||||
#
|
||||
# __stub_index() tests.
|
||||
#
|
||||
|
||||
# Echoes index of given stub.
|
||||
STUB_INDEX=("uname=1" "top=3")
|
||||
assert '__stub_index "uname"' "1"
|
||||
assert '__stub_index "top"' "3"
|
||||
unset STUB_INDEX
|
||||
|
||||
# Echoes nothing if stub is not in the index.
|
||||
STUB_INDEX=("uname=1")
|
||||
assert '__stub_index "top"' ""
|
||||
unset STUB_INDEX
|
||||
|
||||
|
||||
# End of tests.
|
||||
assert_end "__stub_index()"
|
||||
Reference in New Issue
Block a user