kostonstyle
Hi all
I am reading the phoenixframework book and says in the testing section, that we should avoid mocks for testing why?
Thanks
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
apply_graft/2 doesn’t rewrite an add_many sub-workflow’s deps on an add step. Grafted jobs cancel with “upstream job was deleted”
Version...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 25 to 16- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
archan937
Released MecksUnit v0.1.2 in which you can assert function calls with either
called(returns a boolean) orassert_called(raises an error when not having found a match):archan937
It works when running tests asynchronously (which produces child processes) if that’s what you mean. Could otherwise give an example of a different setup with multiple processes?
mindreframer
@archan937 does this also work with multiple processes?
archan937
You mean indirectly? Then the answer is yes. I have added the module
Foowithin the example which invokesString.trim()and the tests succeedbenwilson512
Does it work if
String.trimis called outside that block?archan937
Ok, cool. I’m very happy to know what you think about MecksUnit. And btw, I just pushed a new version in which defining mock modules are done far more elegantly

Please note that you have to use
defmockandmocked_test. Nice, huh?Cochonours
That’s interesting, I’ll give it a try!
sribe
Rebinding is exactly what it is. Perhaps you meant it is not reassignment???
archan937
I would rather use GitHub - archan937/mecks_unit: A simple Elixir package to elegantly mock module functions within (asynchronous) ExUnit tests using Erlang's :meck library · GitHub … (async) mocking using the Erlang
:mecklibrary. I don’t want to compromis (by altering my initial code and making things interchangeable) because I just want to unit test my code.kostonstyle
There is a lot of information, could someone make a summary.
Thanks