mirror of
https://github.com/jimeh/stub.sh.git
synced 2026-02-19 13:46:40 +00:00
Update function reference to reflect changes in function comments
This commit is contained in:
31
README.md
31
README.md
@@ -116,14 +116,15 @@ restore uname
|
|||||||
|
|
||||||
- **`stub`**: Basic stubbing command.
|
- **`stub`**: Basic stubbing command.
|
||||||
- `$1`: Name of command to stub
|
- `$1`: Name of command to stub
|
||||||
- `$2`: When set to "STDERR" or "STDOUT", will echo a default message to
|
- `$2`: (optional) When set to "STDERR" or "STDOUT", will echo a default
|
||||||
specified output. If no output is specified, nothing is echoed
|
message to specified output. If no output is specified, nothing is
|
||||||
(optional).
|
echoed.
|
||||||
- **`stub_and_echo`**: Stub given command and echo a custom string to STDOUT.
|
- **`stub_and_echo`**: Stub given command and echo a custom string to STDOUT.
|
||||||
- `$1`: Name of command to stub.
|
- `$1`: Name of command to stub.
|
||||||
- `$2`: String to echo when stub is called.
|
- `$2`: String to echo when stub is called.
|
||||||
- `$3`: When set to "STDERR", echo to STDERR instead of STDOUT (optional).
|
- `$3`: (optional) When set to "STDERR", echo to STDERR instead of STDOUT.
|
||||||
- **`stub_and_eval`**: Stub given command and execute custom commands via eval.
|
- **`stub_and_eval`**: Stub given command and execute custom commands via
|
||||||
|
eval.
|
||||||
- `$1`: Name of command to stub.
|
- `$1`: Name of command to stub.
|
||||||
- `$2`: String to eval when stub is called.
|
- `$2`: String to eval when stub is called.
|
||||||
- **`restore`**: Restores use of original binary/function that was stubbed.
|
- **`restore`**: Restores use of original binary/function that was stubbed.
|
||||||
@@ -154,31 +155,31 @@ restore uname
|
|||||||
- **`stub_called_with`**: Check if given stub has been called with specified
|
- **`stub_called_with`**: Check if given stub has been called with specified
|
||||||
arguments.
|
arguments.
|
||||||
- `$1`: Name of stub to check.
|
- `$1`: Name of stub to check.
|
||||||
- `$@`: All additional arguments are used to specify what stub was called
|
- `$@`: Any/all additional arguments are used to specify what stub was
|
||||||
with.
|
called with.
|
||||||
- **`stub_called_with_times`**: Find out how many times a stub has been
|
- **`stub_called_with_times`**: Find out how many times a stub has been
|
||||||
called with specified arguments.
|
called with specified arguments.
|
||||||
- `$1`: Name of stub to check.
|
- `$1`: Name of stub to check.
|
||||||
- `$@`: All additional arguments are used to specify what stub was called
|
- `$@`: Any/all additional arguments are used to specify what stub was
|
||||||
with.
|
called with.
|
||||||
- **`stub_called_with_exactly_times`**: Validate that stub has been called
|
- **`stub_called_with_exactly_times`**: Validate that stub has been called
|
||||||
with specified arguments exactly given number of times.
|
with specified arguments exactly given number of times.
|
||||||
- `$1`: Name of stub to check.
|
- `$1`: Name of stub to check.
|
||||||
- `$2`: Exact number of times stub should have been called.
|
- `$2`: Exact number of times stub should have been called.
|
||||||
- `$@`: All additional arguments are used to specify what stub was called
|
- `$@`: Any/all additional arguments are used to specify what stub was
|
||||||
with.
|
called with.
|
||||||
- **`stub_called_with_at_least_times`**: Validate that stub has been called
|
- **`stub_called_with_at_least_times`**: Validate that stub has been called
|
||||||
with specified arguments at least X number of times.
|
with specified arguments at least X number of times.
|
||||||
- `$1`: Name of stub to check.
|
- `$1`: Name of stub to check.
|
||||||
- `$2`: Minimum number of times stub should have been called.
|
- `$2`: Minimum number of times stub should have been called.
|
||||||
- `$@`: All additional arguments are used to specify what stub was called
|
- `$@`: Any/all additional arguments are used to specify what stub was
|
||||||
with.
|
called with.
|
||||||
- **`stub_called_with_at_most_times`**: Validate that stub has been called
|
- **`stub_called_with_at_most_times`**: Validate that stub has been called
|
||||||
with specified arguments no more than X number of times.
|
with specified arguments no more than X number of times.
|
||||||
- `$1`: Name of stub to check.
|
- `$1`: Name of stub to check.
|
||||||
- `$2`: Maximum number of times stub should have been called.
|
- `$2`: Maximum number of times stub should have been called.
|
||||||
- `$@`: All additional arguments are used to specify what stub was called
|
- `$@`: Any/all additional arguments are used to specify what stub was
|
||||||
with.
|
called with.
|
||||||
|
|
||||||
|
|
||||||
## Todo
|
## Todo
|
||||||
|
|||||||
Reference in New Issue
Block a user