在eunit测试中是否可以设置被测代码中使用的环境变量?这与**error:undef
:
example_test() ->
application:set_env(an_app, example_key, "value").
编辑:
错误显示的并不多,但这里是完整的堆栈:
env_request_handler_tests: a_test_ (example_test)...*failed*
in function application:set_env/3
called as set_env(an_app,example_key,"value")
in call from env_request_handler_tests:'-a_test_/0-fun-2-'/1 (include/test_fixture.hrl, line 13)
**error:undef