<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="391227" data-post-id="391227">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="krasenyp" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/krasenyp/120/39733_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  krasenyp
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I ignore them because they’re meaningless. You should not pass env to a protocol implementation but define implementations based on the environment. Then your code uses the protocol itself and doesn’t care about the implementation or the environment.</p>
<p>Hardcoding names to processes is another code smell you apparently use. Always keep the option to start a non-named process.</p>
<p>If we’re talking about unit tests, why are you not keeping your functions pure? Why they start processes which involve database calls?</p>
<p>P.S. me and <a class="mention" href="/u/mudasobwa" rel="nofollow">@mudasobwa</a> talk about the same thing. Just two different ways to achieve it.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="391227" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/what-api-mocking-tool-are-elixir-teams-using/75844/22">Post #21</a>
	                </div>
	            </div>
              <div id="likers-container-391227" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="391227"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #21"></div>
  </section>
</div>
    <div class="postbit" id="391228" data-post-id="391228">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="funboy" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  funboy
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="krasenyp" data-post="22" data-topic="75844">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/krasenyp/48/39733_2.png" class="avatar"> krasenyp:</div>
<blockquote>
<p>I ignore them because they’re meaningless.</p>
</blockquote>
</aside>
<p>how problems such as more complex test setup, dependencies on other processes - which often leads to NON async tests, and db calls that shoudn’t happen in unit tests are meaningless? <img src="https://forum.elixirforum.com/images/emoji/apple/thinking.png?v=15" title=":thinking:" class="emoji" alt=":thinking:" loading="lazy" width="20" height="20"></p>
<aside class="quote no-group" data-username="krasenyp" data-post="22" data-topic="75844">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/krasenyp/48/39733_2.png" class="avatar"> krasenyp:</div>
<blockquote>
<p>You should not pass env to a protocol implementation but</p>
</blockquote>
</aside>
<p>I never did - I just asked if I correctly understood u but I didn’t get response for it <img src="https://forum.elixirforum.com/images/emoji/apple/sad_but_relieved_face.png?v=15" title=":sad_but_relieved_face:" class="emoji" alt=":sad_but_relieved_face:" loading="lazy" width="20" height="20"></p>
<blockquote>
<p>Always keep the option to start a non-named process.</p>
</blockquote>
<p>that’s not a solution for where u calling genserver very deep down in a code - unless u pass process name through dozen function which is smell too <img src="https://forum.elixirforum.com/images/emoji/apple/grimacing.png?v=15" title=":grimacing:" class="emoji" alt=":grimacing:" loading="lazy" width="20" height="20"></p>
<blockquote>
<p>why are you not keeping your functions pure?</p>
</blockquote>
<p>because we write systems that have to do sth - we cannot have all functions in entire system pure <img src="https://forum.elixirforum.com/images/emoji/apple/grimacing.png?v=15" title=":grimacing:" class="emoji" alt=":grimacing:" loading="lazy" width="20" height="20"></p>
<aside class="quote no-group" data-username="mudasobwa" data-post="20" data-topic="75844">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mudasobwa/48/5298_2.png" class="avatar"> mudasobwa:</div>
<blockquote>
<p>am not sure how you came from stubbing <code>moduleB</code> to mocking the <code>GenServer</code></p>
</blockquote>
</aside>
<p>I didn’t <img src="https://forum.elixirforum.com/images/emoji/apple/smiley.png?v=15" title=":smiley:" class="emoji" alt=":smiley:" loading="lazy" width="20" height="20"><br>
you wrote <code>HTTP call or spawning a process is already a dependency. </code><br>
so I asked if I should abstract away GenServer call like we did with HTTP calls - that was just a question</p>
<blockquote>
<p>The proper design is the <code>GenServer</code> is not tied to</p>
</blockquote>
<p>That’s the ideal design, and I completely agree. Thanks!</p>
<p>But I live in the real world, where not every project is designed that way. I have to work with the codebase as it is, because I can’t realistically refactor a 500k-line project while also delivering my day-to-day work, sorry <img src="https://forum.elixirforum.com/images/emoji/apple/pensive_face.png?v=15" title=":pensive_face:" class="emoji" alt=":pensive_face:" loading="lazy" width="20" height="20"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="391228" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/what-api-mocking-tool-are-elixir-teams-using/75844/23">Post #22</a>
	                </div>
	            </div>
              <div id="likers-container-391228" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="391228"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #22"></div>
  </section>
</div>
    <div class="postbit" id="391229" data-post-id="391229">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="mudasobwa" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mudasobwa/120/5298_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  mudasobwa
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Cure</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="funboy" data-post="23" data-topic="75844">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/f/ee7513/48.png" class="avatar"> funboy:</div>
<blockquote>
<p>I asked if I should abstract away GenServer call like we did with HTTP calls</p>
</blockquote>
</aside>
<p>Then ask that and I’ll respond. The example you supplied has nothing to do with that particular question. Answering this, yes, you should make the <code>GenServer</code> implementation a dependency, and use mocking library to validate it has been properly called (besides returning whatever is needed for tests all the turtles down.)</p>
<aside class="quote no-group" data-username="funboy" data-post="23" data-topic="75844">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/f/ee7513/48.png" class="avatar"> funboy:</div>
<blockquote>
<p>I can’t realistically refactor a 500k-line project</p>
</blockquote>
</aside>
<p>Then please stop arguing that mocking whatever is <em>good</em>. I accept the argument “it’s lame, but I have neither courage nor ability to do it right.”</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="391229" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/what-api-mocking-tool-are-elixir-teams-using/75844/24">Post #23</a>
	                </div>
	            </div>
              <div id="likers-container-391229" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="391229"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #23"></div>
  </section>
</div>
    <div class="postbit" id="391230" data-post-id="391230">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="funboy" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  funboy
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="mudasobwa" data-post="24" data-topic="75844">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mudasobwa/48/5298_2.png" class="avatar"> mudasobwa:</div>
<blockquote>
<p>Then ask that and I’ll respond.</p>
</blockquote>
</aside>
<aside class="quote no-group" data-username="funboy" data-post="16" data-topic="75844">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/f/ee7513/48.png" class="avatar"> funboy:</div>
<blockquote>
<p>do u think I should abstract away e.g. GenServer?</p>
</blockquote>
</aside>
<p>I already asked at the very beginning, but instead of answer I was getting allegations <img src="https://forum.elixirforum.com/images/emoji/apple/grimacing.png?v=15" title=":grimacing:" class="emoji" alt=":grimacing:" loading="lazy" width="20" height="20"></p>
<p>but thank u for answering it anyway <img src="https://forum.elixirforum.com/images/emoji/apple/folded_hands.png?v=15" title=":folded_hands:" class="emoji" alt=":folded_hands:" loading="lazy" width="20" height="20"></p>
<aside class="quote no-group" data-username="mudasobwa" data-post="24" data-topic="75844">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mudasobwa/48/5298_2.png" class="avatar"> mudasobwa:</div>
<blockquote>
<p>Then please stop arguing that mocking whatever is <em>good</em>.</p>
</blockquote>
</aside>
<p>that’s was never my statement - but I see u guys know better - thank u for discussion <img src="https://forum.elixirforum.com/images/emoji/apple/folded_hands.png?v=15" title=":folded_hands:" class="emoji" alt=":folded_hands:" loading="lazy" width="20" height="20"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="391230" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/what-api-mocking-tool-are-elixir-teams-using/75844/25">Post #24</a>
	                </div>
	            </div>
              <div id="likers-container-391230" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="391230"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #24"></div>
  </section>
</div>
    <div class="postbit" id="392717" data-post-id="392717">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Lewis" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Lewis/120/40668_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Lewis
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>so strong. I think in the busy of work I forgot to check-in, but this does seem a bit off the rails of the original conversation. Thank you all I’ve found uses of both where I work. I am indifferent to injection vs patching arguments; both seem valid to me. I was really hoping there might be something that can be injected or patched like VCR in the python world; where it records a http, and then checks the code still conforms to that. I like it’s golden master style and also that updating is considered in the framework, as well as network isolation and provision for erroring if network access is attempted on some non-mocked / unexpected endpoint is reached. I think in this AI world, having knowledge of access to unexpected / new networks brings good habits; but again, strong opinion, weakly held</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="392717" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/what-api-mocking-tool-are-elixir-teams-using/75844/26">Post #25</a>
	                </div>
	            </div>
              <div id="likers-container-392717" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="392717"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #25"></div>
  </section>
</div>
    <div class="postbit" id="392718" data-post-id="392718">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="mudasobwa" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mudasobwa/120/5298_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  mudasobwa
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Cure</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="Lewis" data-post="26" data-topic="75844">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/lewis/48/40668_2.png" class="avatar"> Lewis:</div>
<blockquote>
<p>where it records a http, and then checks the code still conforms to that</p>
</blockquote>
</aside>
<p>This approach can only cover the happy path, what makes the whole testing meaningless in a real world.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="392718" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/what-api-mocking-tool-are-elixir-teams-using/75844/27">Post #26</a>
	                </div>
	            </div>
              <div id="likers-container-392718" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="392718"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #26"></div>
  </section>
</div>
    <div class="postbit" id="392721" data-post-id="392721">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Lewis" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Lewis/120/40668_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Lewis
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>This is a very specific assertion which vcr absolutely deals with. Error codes, dns lookups. There is nothing in code which cannot be used to simulate error cases</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="392721" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/what-api-mocking-tool-are-elixir-teams-using/75844/28">Post #27</a>
	                </div>
	            </div>
              <div id="likers-container-392721" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="392721"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #27"></div>
  </section>
</div>
    <div class="postbit" id="392724" data-post-id="392724">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="nseaSeb" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/nseaSeb/120/30165_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  nseaSeb
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I might not have fully grasped the exact request in the post, but for interactive testing and exploring—or even replacing—external tools like Postman or WireMock, the combination of Livebook, Req, and Kino seems brilliant to me. To be honest, I haven’t tested it yet, but if I were to do so, I think that’s where I’d start—wouldn’t you?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="392724" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/what-api-mocking-tool-are-elixir-teams-using/75844/29">Post #28</a>
	                </div>
	            </div>
              <div id="likers-container-392724" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="392724"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #28"></div>
  </section>
</div>
    <div class="postbit" id="392729" data-post-id="392729">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Asd" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Asd
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p><a href="https://test-server.hexdocs.pm/TestServer.html" rel="noopener nofollow ugc">TestServer</a> + <a href="https://repatch.hexdocs.pm/readme.html" rel="noopener nofollow ugc">Repatch</a></p>
<p>You can configure test server to integrate with OpenAPI via Plug</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="392729" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/what-api-mocking-tool-are-elixir-teams-using/75844/30">Post #29</a>
	                </div>
	            </div>
              <div id="likers-container-392729" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="392729"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>