Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marick/mockery_extras
Helper code and documentation for Mockery
https://github.com/marick/mockery_extras
Last synced: about 1 month ago
JSON representation
Helper code and documentation for Mockery
- Host: GitHub
- URL: https://github.com/marick/mockery_extras
- Owner: marick
- License: unlicense
- Created: 2021-03-14T21:31:37.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-04-01T00:59:38.000Z (almost 4 years ago)
- Last Synced: 2024-03-14T19:18:14.605Z (10 months ago)
- Language: Elixir
- Size: 83 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MockeryExtras
Additions to [`mockery`](https://github.com/appunite/mockery) that may
make your programming life a bit more pleasant.Provides:
* A [simple way](https://hexdocs.pm/mockery_extras/MockeryExtras.Given.html#content) to stub function calls:
```elixir
use Given
given Map.get(%{}, :key), return: "5"
given Map.get(@any, :key), return: "5"
```* [Easy definition of getters](https://hexdocs.pm/mockery_extras/MockeryExtras.Getters.html#content) for complex structures, plus support code
for insulating client code and tests from details of that structure.
See [Stubbing Complex Structures](stubbing_complex_structures.md).## Installation
Add `mockery_extras` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[
{:mockery_extras, "~> 0.2.0"}
]
end
```Documentation is at
[https://hexdocs.pm/mockery_extras](https://hexdocs.pm/mockery_extras).