not sure if this is the best way, but it should work =)
script.exs
defmodule Foo do
def bar, do: :baz
end
In the same dir put script_test.exs
Code.require_file("script.exs")
ExUnit.start()
defmodule FooTest do
use ExUnit.Case
test "bar/0 does :baz" do
assert :baz == Foo.bar()
end
end
and run the test with
elixir script_test.exs


















