Closed real34 closed 9 years ago
There is a problem with scopes when using think in a test which needs to access methods defined externally.
think
For instance in about_name_function.exs replacing think with test for the first test causes the following error:
about_name_function.exs
test
** (CompileError) about_named_function.exs:10: function hello/1 undefined src/elixir_translator.erl:40: :elixir_translator.translate_each/2 lists.erl:1339: :lists.mapfoldl/3 src/elixir_translator.erl:58: :elixir_translator.translate_each/2 about_named_function.exs:10: About_Named_Functions (module) about_named_function.exs:9: About_Named_Functions (module)
After searching I found Module.eval_quoted which may be a solution, but I could not make it work.
Module.eval_quoted
Tested on Elixir v0.11.3-dev
There is a problem with scopes when using
think
in a test which needs to access methods defined externally.For instance in
about_name_function.exs
replacingthink
withtest
for the first test causes the following error:After searching I found
Module.eval_quoted
which may be a solution, but I could not make it work.Tested on Elixir v0.11.3-dev