title: Elixir: doctesting a sigil
body: <p>I wrote an awesome sigil:</p>
  
  <pre class="lang-elixir prettyprint-override"><code>defmodule Sigiltest do
  
    @doc """
    An awesome sigil!
  
    ### Usage
  
        iex&gt; ~a{I love elixir}
        "I love elixir, awesome!"
    """
    def sigil_a(content, _flags) do
      "#{content}, awesome!"
    end
  end
  </code></pre>
  
  <p>Here is the tests module:</p>
  
  <pre class="lang-elixir prettyprint-override"><code>defmodule SigiltestTest do
    use ExUnit.Case
    doctest Sigiltest
  end
  </code></pre>
  
  <p>When I run <code>mix test</code> I get the following output:</p>
  
  <pre><code>Compiled lib/sigiltest.ex
  ** (CompileError) (for doctest at) lib/sigiltest.ex:7: undefined function sigil_a/2
      (stdlib) lists.erl:1337: :lists.foreach/2
      (stdlib) erl_eval.erl:670: :erl_eval.do_apply/6
  </code></pre>
  
  <p>Is there a way to run doctests on a sigil?
  If so, how?</p>