elixir-lang / elixir

Elixir is a dynamic, functional language for building scalable and maintainable applications
https://elixir-lang.org/
Apache License 2.0
24.34k stars 3.36k forks source link

ExUnit.Assertions in a describe block lead to confusing error messages #7932

Closed adkron closed 6 years ago

adkron commented 6 years ago

Precheck

Environment

Elixir 1.6.3 (compiled with OTP 19)

Current behavior

describe "foo" do
  flunk "Anything that is an assertion will cause a compilation error."
end
== Compilation error in file test/model_manager_test.exs ==
** (ExUnit.AssertionError)

Expected behavior

Assertions must be inside of a `test` block.

I don't know if that is the best error, but the current one leads to a lot of headaches. If we could make a better message here we could save developers a lot of time.

fertapric commented 6 years ago

I think this might be a duplicate of https://github.com/elixir-lang/elixir/issues/7683

adkron commented 6 years ago

It does look like a duplicate, Thanks.