Skip to content

Commit

Permalink
docs: add assert_is_mock to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Chemaclass committed Dec 10, 2023
1 parent ade6ed5 commit 4907d20
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
- Add `assert_contains_ignore_case`
- Add `assert_equals_ignore_colors`
- Add `assert_match_snapshot`
- Add `assert_is_mock`
- Add `assert_is_not_mock`
- Add `unmock`
- Add `assert_is_mock`
- Add `assert_is_not_mock`
- Add `SHOW_EXECUTION_TIME` to environment config
- Add docs for environment variables
- Improve data provider output
Expand Down
50 changes: 50 additions & 0 deletions docs/assertions.md
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,31 @@ function test_failure() {
```
:::

## assert_is_mock
> `assert_is_mock "expected"`
Reports an error if expected is not a mock.

[assert_is_not_mock](#assert-is-not-mock) is the inverse of this assertion.

::: code-group
```bash [Example]
function test_success_mock() {
mock ls
assert_is_mock ls
}

function test_success_spy() {
spy ls
assert_is_mock ls
}

function test_failure() {
assert_is_mock ls
}
```
:::

## assert_not_equals
> `assert_not_equals "expected" "actual"`
Expand Down Expand Up @@ -856,3 +881,28 @@ function test_failure() {
}
```
:::

## assert_is_not_mock
> `assert_is_not_mock "expected"`
Reports an error if expected is a mock.

[assert_is_mock](#assert-is-mock) is the inverse of this assertion.

::: code-group
```bash [Example]
function test_success() {
assert_is_not_mock ls
}

function test_failure_mock() {
mock ls
assert_is_not_mock ls
}

function test_failure_spy() {
spy ls
assert_is_not_mock ls
}
```
:::

0 comments on commit 4907d20

Please sign in to comment.