racket-mock
racket-mock copied to clipboard
Mocking library for Racket
I'm currently writing tests for a file that has a bunch of functions modifying shared state and, based on that state, performing I/O, sometimes using callbacks/thunks created in other functions....
Did I mention I'm a huge fan of the arguments package? There's just one thing that I wish it had -- syntactic unpacking of arguments at definition and at invocation...
Reflecting on arity information is pretty disorganized. There's `procedure-arity-includes?`, `procedure-arity`, `arity-includes?`, `procedure-keywords`, `normalize-arity`, and `arity=?`. A small package to complement `arguments` might help here.
This is mostly to make sure I understand the syntax system better. Currently `define/mock` and `with-mocks` communicate in the following manner: 1. The `define/mock` form creates an identifier for each...
By making mock call histories [disposables](http://docs.racket-lang.org/disposable/), it should be possible to provide a variant of `with-mocks` that uses [fixtures](http://docs.racket-lang.org/fixture/). This could be a potential solution to #31, as nested test...
Testing with mocks can have lots of subtle cases where it's not clear how to properly use them. A Guide as discussed in #10 would help somewhat, but many approaches...
Mocks use some fairly complex macrology. A document describing the general strategy and some of the hairier details would be very useful to myself for future reference, and possibly useful...
It should be possible to impose contracts on mock behaviors, such as "this behavior should always return an integer". This can be combined with machinery to pull contracts off of...
If I mock out a dependency with a contract, I'm vulnerable to "falsely passing" tests if that dependency's API changes. When using `define/mock`, it should be possible to automatically extract...
Often a function tested with mocks may have multiple behaviors that need to be tested and which require mocks be set up in different ways. `mock-reset!` and `with-mock-behavior` provide building...