mudasobwa

mudasobwa

Creator of Cure

Mocks Are Your Friends, Not Your Servants

Łukasz wrote a great article, 'guiding not ruling’ the way of writing tests. I agree with everything, short of his attitude to mocks. The furter discussion revealed that we treat mocks in an absolutely different manner.

I :heart: mocks, and here is why.

Most Liked

felix-starman

felix-starman

I need to restart my work on DoubleAgent. I was discouraged by all the mock libraries that came out and I never had time to come back and finish it, but maybe this will give me the kick in the pants to do it.

I generally agree with all of the things you said here. My only addition to the conversation is to not call it a mock anymore since there’s too much baggage around it or people misunderstand it.

I like the framing of it as something that collaboratively works with you to validate the contract from the inside.

I have thought similarly for a long time and that was part of why after using double and working with its creator/mantainer in the past I thought a better name would be double agent, because it’s running in the implementation but it’s working for you.

I also have a whole lot of plans for how it can be iteratively employed and guide you from a very simple non-ideal approach to a fully speced out behaviour where all of the best features come about and become easy from following the best practices.

It’s a great article. Thank you for writing it

code-shoily

code-shoily

Just shared this with colleagues. Loved this article.

Where Next?

Popular in Blog Posts Top

biportal
Hi, I recently thought about a name for this Stack: Rust + Elixir + Phoenix. I came up with Runix (RuNix) and blogged about it on Medium....
New
mudasobwa
Just blogged on the general approach to creating easily extendable applications with plugin support.
New
luckywatcher
Hey all! I just started a blog focused on web development in Elixir. I wrote my first article and thought I’d post it here for the whole...
New
John-BoothIQ
TL;DR: Good: AI is great at Elixir. It gets better as your codebase grows. Bad: It defaults to defensive, imperative code. You need...
New
T0ha666
In this article, we discuss how to create a Docker image for a Phoenix application. https://t0ha.ru/en/devops/elixir/2023/11/10/how-to-b...
New
JEG2
I’m closing out, for now, my series on questions at the heart of development with an analysis of when we need more abstraction. For exam...
New
mssantosdev
This post is a guide on how Norba and I are building LiveMatch, a real-time app for soccer to follow multiple games in one place. https:...
New
DevotionGeo
There are 3 main formatters for Erlang which you can use from the command-line, rebar3_format, Steamroller elmfmt. Visual Studio Code’...
New
paulanthonywilson
Whatever your Nerves project does, there’s a good chance that it can be enhanced by securely connecting to a Phoenix Server in the cloud;...
New
brainlid
Jason Stiebs shows a couple ways for a LiveView to make it easy for users to click and copy an important value to their clipboard. He sho...
New

Other popular topics Top

senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
chrismccord
As promised, the first release candidate of Phoenix 1.3.0 is out! This release focuses on code generators with improved project structure...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 30877 112
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
jaysoifer
Is there a way to rollback a specific migration and only that one (“skipping” all the other ones)? Would mix ecto.rollback -v 200809061...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement