有没有办法在eunit测试中调用application:set_env?

时间:2015-09-12 22:29:57

标签: erlang eunit

在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

0 个答案:

没有答案