title: Erlang EUnit test module that depends on a library application
body: <p>I have a medium-sized release with a handful of applications.  I recently refactored some common functionality out into a library application within the release.  This made my EUnit tests fail with <code>undef</code> messages whenever testing anything that required the library application.  </p>
  
  <p>The set up is something like this:</p>
  
  <pre><code>% In apps/utils/src/utils.erl
  -module(utils).
  
  -export([foo/0]).
  
  foo() -&gt; "OH HAI".
  </code></pre>
  
  <p>Then</p>
  
  <pre><code>% In apps/some_app/src/some_app.erl
  -module(some_app).
  
  -export([bar/0]).
  
  bar() -&gt; io:format("foo: ~s~n", [utils:foo()]).
  
  % unit tests for bar()
  </code></pre>
  
  <p>Then the unit tests for <code>some_app:bar()</code> fail.  I'm running them with <code>rebar eunit skip_deps=true</code>.  I'm using <code>skip_deps=true</code> because my release uses some 3rd party applications (SQL, etc).</p>
  
  <p>I assume that the tests start failing because EUnit is invoking the app under test without its dependencies?  Is there any way to fix this?  I have configured the .app file to explicitly declare the dependency.  It works fine in the release, and it's been deployed for about a day now with no problem, but I'll feel a lot better if I can get the tests to pass again :)</p>
  
  <p>(I could use a mocking app to stub out <code>utils:foo/0</code>, and I can see where that would be ideal idiomatically, but that seems like overkill in this case because <code>utils:foo/0</code> (read: it's real-world counterpart) does some really simple stuff.)</p>