josephwilk / amrita

A polite, well mannered and thoroughly upstanding testing framework for Elixir
201 stars 28 forks source link

Amrita does not work without `ExUnit` declaration #118

Open lowks opened 10 years ago

lowks commented 10 years ago

Just to test out if the latest amrita works, I created a project from scratch with the following details:

My mix.exs:

defmodule TestAmrita.Mixfile do
  use Mix.Project

  def project do
    [app: :test_amrita,
     version: "0.0.1",
     elixir: "~> 1.0.0",
     deps: deps]
  end

  # Configuration for the OTP application
  #
  # Type `mix help compile.app` for more information
  def application do
    [applications: [:logger]]
  end

  # Dependencies can be Hex packages:
  #
  #   {:mydep, "~> 0.3.0"}
  #
  # Or git/path repositories:
  #
  #   {:mydep, git: "https://github.com/elixir-lang/mydep.git", tag: "0.1.0"}
  #
  # Type `mix help deps` for more examples and options
  defp deps do
    [{:amrita, "~>0.4", github: "josephwilk/amrita"}]
  end
end

Then I just added the following details:

test/test_helper.exs

Amrita.start(formatter: Amrita.Formatter.Documentation)

and

test/test_amrita_test.exs (My project is called 'test_amrita')

Code.require_file "../test_helper.exs", __ENV__.file

defmodule ExampleFacts do
  use Amrita.Sweet

  fact "addition" do
    1 + 1 |> 2
  end
end

I ran mix amrita --trace

and here is my result:

** (RuntimeError) cannot use ExUnit.Case without starting the ExUnit application, please call ExUnit.start() or explicitly start the :ex_unit app
    (ex_unit) expanding macro: ExUnit.Case.__using__/1
    test/test_amrita_test.exs:4: ExampleFacts (module)
    (elixir) expanding macro: Kernel.use/2
    test/test_amrita_test.exs:4: ExampleFacts (module)
    (elixir) expanding macro: Kernel.if/2
    test/test_amrita_test.exs:4: ExampleFacts (module)
    expanding macro: Amrita.Sweet.__using__/1
    test/test_amrita_test.exs:4: ExampleFacts (module)
divmgl commented 9 years ago

+1, I'm having this issue as well.