patch
patch copied to clipboard
Ergonomic Mocking for Elixir
Something I noticed is that when adding `use patch` with a test file, that file and corresponding implementation file are removed from the coverage report when invoking with `mix test...
Hello I have some GenServer that subscribe to Phoenix.PubSub channel to reduce code coupling I feel like something is missing Patch (that is really nice btw). My workflow is everytime...
From [Elixir changelog for 1.16](https://hexdocs.pm/elixir/changelog.html#4-hard-deprecations): > 4. Hard deprecations -[String] Deprecate passing a range with negative step on [String.slice/2](https://hexdocs.pm/elixir/String.html#slice/2), give first..last//1 instead ``` @doc """ Formats the AST for a...
This fixes deprecation warnings at runtime on elixir 1.16. ``` warning: negative steps are not supported in String.slice/2, pass 1..-2//1 instead (elixir 1.16.1) lib/string.ex:2369: String.slice/2 (elixir 1.16.1) src/elixir_dispatch.erl:228: :elixir_dispatch.expand_macro_fun/7 (elixir...
Hey, thanks for this great library! My testing logs are getting flooded by messages like ``` Error: 16:14:39.389 [error] Patch.Mock.Server Patch.Mock.Server.For.Some.Module received unexpected message in handle_info/2: {:EXIT, #PID, :normal} ```...
If you try to call `Ecto.Changeset.cast` inside of a patched function, it raises an `** (EXIT) process attempted to call itself` Minimum reproduction: ```elixir defmodule ToBePatched do use Ecto.Schema embedded_schema...
When a test patches multiple modules with many test cases it can lead to poor performance. The current lifecycle of patching looks like this. 1. On `setup` start a `Patch.Supervisor`...
Patch wants to own various symbols in a test but these can conflict with symbols the author might be importing either directly or indirectly. A good example is that Phoenix...
Does Patch.Macro not support map keys properly? ```elixir key = "key" value = "value" assert_called Example.example(%{^key => ^value}) ``` Unverified report that this might not work, check it out.
I have noticed that trying to patch non-existing modules, results in an error, that may be quite difficult to understand. The following code ```Elixir patch(NoSuchModule, :function_that_does_not_exist, fn _x -> 42...