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


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="SeanShubin" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/SeanShubin/120/30038_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  SeanShubin
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="benwilson512" data-post="13" data-topic="57135">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/benwilson512/48/1457_2.png" class="avatar"> benwilson512:</div>
<blockquote>
<p>Please watch the linked video, or read through the Mox docs</p>
</blockquote>
</aside>
<p>I did watch the linked video and read through the Mox dox, so please know that I am taking all of your feedback seriously.  Hopefully it becomes more clear once I have time to work on an example this weekend.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="295299" 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/is-this-a-better-way-to-test-elixir/57135/22">Post #21</a>
	                </div>
	            </div>
              <div id="likers-container-295299" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="295299"
                     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="295300" data-post-id="295300">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="benwilson512" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/benwilson512/120/1457_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  benwilson512
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Author of Craft GraphQL APIs in Elixir with Absinthe</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="SeanShubin" data-post="21" data-topic="57135">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/seanshubin/48/30038_2.png" class="avatar"> SeanShubin:</div>
<blockquote>
<p>Mox is somehow using the process dictionary to keep expectations isolated?</p>
</blockquote>
</aside>
<p>100%, it is doing exactly this.</p>
<aside class="quote no-group" data-username="SeanShubin" data-post="21" data-topic="57135">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/seanshubin/48/30038_2.png" class="avatar"> SeanShubin:</div>
<blockquote>
<p>I keep hearing how Mox allows for separate implementations when I am worried about separate state.</p>
</blockquote>
</aside>
<p>Right so the bit that I think is tripping you up is that that there are two distinct questions:</p>
<ol>
<li>What expectation functions should execute for the current caller pid.</li>
<li>What should those functions return when they model something stateful.</li>
</ol>
<p>Thing (1) there is where Mox’s pdict magic handles executing different functions for different caller pids. But the thing that makes all this work is that those functions have no intrinsic statefulness at all, which makes it trivial for you to add in whatever statefulness you want to adjust (2) in whatever way is best for your tests and the stateful system you want to manage. So you can do things like:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir"># In a test
{:ok, time_pid} = MyTestTime.start_link(initial_time)

Mox.expect(TimeMock, :monotonic_time, 2, fn -&gt;
  MyTestTime.get_current_time(time_pid)
end)

# run some that calls the MyApp.Time.get_current_time function, where MyApp.Time is a behavior.
assert blah

# Let's move time now!

MyTestTime.set_time(time_pid, my_new_time)

# run more code
</code></pre>
<p>I’ll try to get a more complete example for your code in a bit.</p>
<aside class="quote no-group" data-username="SeanShubin" data-post="22" data-topic="57135">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/seanshubin/48/30038_2.png" class="avatar"> SeanShubin:</div>
<blockquote>
<p>so please know that I am taking all of your feedback seriously.</p>
</blockquote>
</aside>
<p>Fair enough! And I am sorry if I came on strong earlier. Your detailed replies are genuinely helpful, I feel like we are making progress here.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="295300" data-batch-url="/posts/batch_likers">
                        3
                      </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/is-this-a-better-way-to-test-elixir/57135/23">Post #22</a>
	                </div>
	            </div>
              <div id="likers-container-295300" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="295300"
                     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="295302" data-post-id="295302">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="benwilson512" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/benwilson512/120/1457_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  benwilson512
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Author of Craft GraphQL APIs in Elixir with Absinthe</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>OK here we go!</p>
<p><a href="https://github.com/benwilson512/mox_demo/blob/main/lib/mox_demo.ex" class="onebox" target="_blank" rel="noopener nofollow">https://github.com/benwilson512/mox_demo/blob/main/lib/mox_demo.ex</a></p>
<p>This has your <code>main</code> function. As you can see I have swapped out the <code>System</code> <code>IO</code> and <code>File</code> to the general IO behavior module I define here. <a href="https://github.com/benwilson512/mox_demo/blob/main/lib/io.ex" class="inline-onebox" rel="nofollow">mox_demo/lib/io.ex at main · benwilson512/mox_demo · GitHub</a></p>
<p>As I note in that module, it’s a bit simplistic to put all the IO functions in one module. In the real world you’d probably define multiple behaviors, but I wanted to keep this simple.</p>
<p>Then we have the test:</p>
<p><a href="https://github.com/benwilson512/mox_demo/blob/main/test/mox_demo_test.exs" class="onebox" target="_blank" rel="noopener nofollow">https://github.com/benwilson512/mox_demo/blob/main/test/mox_demo_test.exs</a></p>
<p>As you can see I can define test specific expectations. In the end I didn’t even really need to manage any state, since the ability to chain expectations meant that when you call eg <code>monotonic_time</code> twice I just define two expectations, one with the first value, and one with the second.</p>
<p>I don’t have additional tests in there right now but these expectations are 100% isolated from any other tests that would be happening.</p>
<p>One nice consequence of this approach is that backend being parameterized you still get strong compiler and language server support since it resolves to a compile time value.</p>
<p>This is <em>barely scratching the surface</em> of what’s possible though and ironically, a lot of what’s possible is made possible by how minimalist Mox is. Here is the same test set up a different way where it’s more interactive. Basically instead of setting up all the IO ahead of time and calling <code>main()</code>, we put <code>main</code> in a task and then have it basically “talk to” our test process as if it is the IO world:</p>
<p><a href="https://github.com/benwilson512/mox_demo/blob/main/test/interactive_test.exs" class="onebox" target="_blank" rel="noopener nofollow">https://github.com/benwilson512/mox_demo/blob/main/test/interactive_test.exs</a></p>
<p>All I’m doing here is combining core Elixir primitives like <code>send</code> and <code>receive</code> with Mox. Mox doesn’t really have any state to track here other than knowing which functions to call for this particular invocation of <code>main</code>. Then the “state” of the IO is in this case managed by my test process itself by sending messages to the mock at the appropriate times.</p>
<p>And of course you’ll note that you can just run <code>mix test</code> in the project root directory and these two test files will run at the same time and do not interfere. Both approaches are perfectly valid. I tend to favor the <code>Mox.expect</code> approach when I just have some outside system that I need a value or two from, or that I want to assert we pushed a value to. I tend to use the second approach if I’m writing more of a “simulator” test where there is some IO heavy piece of code and I want to step through it. This particular example makes that look sort of verbose but that <code>setup</code> block is generic. Once you write your little stub you’re done, and each test just gets to really focus on the interaction between the function under testing and the IO.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="295302" data-batch-url="/posts/batch_likers">
                        14
                      </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/is-this-a-better-way-to-test-elixir/57135/24">Post #23</a>
	                </div>
	            </div>
              <div id="likers-container-295302" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="295302"
                     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="295329" data-post-id="295329">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>The <code>compile_env!</code> tip is great –</p>
<p>Does this mean if you have:</p>
<p><code>@backend.i_dont_exist()</code></p>
<p>You’ll get a compiler error?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="295329" 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/is-this-a-better-way-to-test-elixir/57135/25">Post #24</a>
	                </div>
	            </div>
              <div id="likers-container-295329" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="295329"
                     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="295330" data-post-id="295330">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="benwilson512" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/benwilson512/120/1457_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  benwilson512
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Author of Craft GraphQL APIs in Elixir with Absinthe</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Yup! You get the standard warning you get when a function doesn’t exist</p>
<p></p><div class="lightbox-wrapper"><a class="lightbox" href="https://forum.elixirforum.com/uploads/default/original/3X/a/6/a6b4f606e750687eeb1d0084b98f51899f612c79.jpeg" data-download-href="https://forum.elixirforum.com/uploads/default/a6b4f606e750687eeb1d0084b98f51899f612c79" title="image" rel="nofollow"><img src="https://forum.elixirforum.com/uploads/default/original/3X/a/6/a6b4f606e750687eeb1d0084b98f51899f612c79.jpeg" alt="image" data-base62-sha1="nMKXYsnOFErwHVioeHGWAVkqXdn" width="690" height="168" data-dominant-color="2C2D2E"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">1200×293 29.9 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><p></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="295330" 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/is-this-a-better-way-to-test-elixir/57135/26">Post #25</a>
	                </div>
	            </div>
              <div id="likers-container-295330" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="295330"
                     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="295331" data-post-id="295331">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>wow. That’s awesome.</p>
<p>I’m going to put out a blog post about this - can I tag 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="295331" data-batch-url="/posts/batch_likers">
                        2
                      </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/is-this-a-better-way-to-test-elixir/57135/27">Post #26</a>
	                </div>
	            </div>
              <div id="likers-container-295331" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="295331"
                     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="295332" data-post-id="295332">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="benwilson512" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/benwilson512/120/1457_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  benwilson512
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Author of Craft GraphQL APIs in Elixir with Absinthe</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Certainly! Feel free to use any of the code in that repo as well!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="295332" data-batch-url="/posts/batch_likers">
                        3
                      </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/is-this-a-better-way-to-test-elixir/57135/28">Post #27</a>
	                </div>
	            </div>
              <div id="likers-container-295332" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="295332"
                     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="295358" data-post-id="295358">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<blockquote>
<p>If you don’t have sources of state as a behavior, it will not be testable with Mox</p>
</blockquote>
<p>This is not entirely true.  The mox documentation is confusing, it says “no ad-hoc mock without a behaviour”, which is true, but you can certainly create an ad-hoc behaviour and build your mock on top of that.</p>
<p>So even if your source of state doesn’t ship with a behaviour API no one will stop you from building you own that uh just so happens to look like the Module you’re building a mock for.  Module calls are just apply/3 and they don’t enforce behaviour besides throwing if the function call doesn’t exist.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="295358" 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/is-this-a-better-way-to-test-elixir/57135/29">Post #28</a>
	                </div>
	            </div>
              <div id="likers-container-295358" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="295358"
                     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="295368" data-post-id="295368">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="benwilson512" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/benwilson512/120/1457_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  benwilson512
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Author of Craft GraphQL APIs in Elixir with Absinthe</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group quote-modified" data-username="ityonemo" data-post="29" data-topic="57135">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/ityonemo/48/11341_2.png" class="avatar"> ityonemo:</div>
<blockquote>
<p>There’s no state or nondeterminism <em>for you</em> to track in the test</p>
</blockquote>
</aside>
<p>I mean, that depends entirely on what you choose to implement with Mox. If you don’t have sources of state as a behavior, it will not be testable with Mox.</p>
<p>I do agree though that once you’ve got Mox in the mix there are many options available.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="295368" 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/is-this-a-better-way-to-test-elixir/57135/30">Post #29</a>
	                </div>
	            </div>
              <div id="likers-container-295368" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="295368"
                     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 #29"></div>
  </section>
</div>
    <div class="postbit" id="295978" data-post-id="295978">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="SeanShubin" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/SeanShubin/120/30038_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  SeanShubin
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Thanks so much for putting the work in, that was really helpful for my prototyping.  You can see my various attempts here:</p>
<ul>
<li><a href="https://github.com/SeanShubin/testability_using_function_references" class="inline-onebox" rel="noopener nofollow ugc">GitHub - SeanShubin/testability_using_function_references · GitHub</a></li>
<li><a href="https://github.com/SeanShubin/testability_using_fakes" class="inline-onebox" rel="noopener nofollow ugc">GitHub - SeanShubin/testability_using_fakes · GitHub</a></li>
<li><a href="https://github.com/SeanShubin/testability_using_mocks" class="inline-onebox" rel="noopener nofollow ugc">GitHub - SeanShubin/testability_using_mocks · GitHub</a></li>
<li><a href="https://github.com/SeanShubin/testability_using_mox" class="inline-onebox" rel="noopener nofollow ugc">GitHub - SeanShubin/testability_using_mox · GitHub</a></li>
</ul>
<p>Now that I got the mechanics down I can try to figure out which I like best and why, but I am too tired for analysis now.  I wanted to post my results here in case anyone else is interested.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="295978" data-batch-url="/posts/batch_likers">
                        5
                      </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/is-this-a-better-way-to-test-elixir/57135/31">Post #30</a>
	                </div>
	            </div>
              <div id="likers-container-295978" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="295978"
                     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 #30"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/57135/load_more?page=4">Load more posts (2 remaining)</a>
</div></template></turbo-stream>