function A.B.c/1 is undefined or private when running `mix tests` but not in console
Follow-up question to this one
function is undefined or private while should be accessible
I'm approximatively experiencing the same issue. A function is considered undefined or private.
The solution in the link above works! In $ iex -S mix phx.server
I run recompile()
and the function is no longer undefined or private.
My issue is that it is still undefined or private in my tests suite.
When I run mix tests
, I get the UndefinedFunctionError
again.
I'm running my tests from the project's root directory.
elixir phoenix-framework
add a comment |
Follow-up question to this one
function is undefined or private while should be accessible
I'm approximatively experiencing the same issue. A function is considered undefined or private.
The solution in the link above works! In $ iex -S mix phx.server
I run recompile()
and the function is no longer undefined or private.
My issue is that it is still undefined or private in my tests suite.
When I run mix tests
, I get the UndefinedFunctionError
again.
I'm running my tests from the project's root directory.
elixir phoenix-framework
1
Can you post the code here? Have you tried callingmix do clean, compile
or just deleting the_build
directory? What else have you tried so far?
– Sheharyar
Nov 20 at 20:06
It is hard to tell without knowing how phoenix endpoint is configured? is it in umbrella? what mix.exs file contents are? where _build folders are? especially in case of umbrella! what dependencies are added since some may fail silently? Did you add some code that depends on configuration? What version of phoenix and elixir u r using?
– Milan Jaric
Nov 21 at 8:18
add a comment |
Follow-up question to this one
function is undefined or private while should be accessible
I'm approximatively experiencing the same issue. A function is considered undefined or private.
The solution in the link above works! In $ iex -S mix phx.server
I run recompile()
and the function is no longer undefined or private.
My issue is that it is still undefined or private in my tests suite.
When I run mix tests
, I get the UndefinedFunctionError
again.
I'm running my tests from the project's root directory.
elixir phoenix-framework
Follow-up question to this one
function is undefined or private while should be accessible
I'm approximatively experiencing the same issue. A function is considered undefined or private.
The solution in the link above works! In $ iex -S mix phx.server
I run recompile()
and the function is no longer undefined or private.
My issue is that it is still undefined or private in my tests suite.
When I run mix tests
, I get the UndefinedFunctionError
again.
I'm running my tests from the project's root directory.
elixir phoenix-framework
elixir phoenix-framework
edited Nov 20 at 20:14
asked Nov 20 at 18:40
David B.
182211
182211
1
Can you post the code here? Have you tried callingmix do clean, compile
or just deleting the_build
directory? What else have you tried so far?
– Sheharyar
Nov 20 at 20:06
It is hard to tell without knowing how phoenix endpoint is configured? is it in umbrella? what mix.exs file contents are? where _build folders are? especially in case of umbrella! what dependencies are added since some may fail silently? Did you add some code that depends on configuration? What version of phoenix and elixir u r using?
– Milan Jaric
Nov 21 at 8:18
add a comment |
1
Can you post the code here? Have you tried callingmix do clean, compile
or just deleting the_build
directory? What else have you tried so far?
– Sheharyar
Nov 20 at 20:06
It is hard to tell without knowing how phoenix endpoint is configured? is it in umbrella? what mix.exs file contents are? where _build folders are? especially in case of umbrella! what dependencies are added since some may fail silently? Did you add some code that depends on configuration? What version of phoenix and elixir u r using?
– Milan Jaric
Nov 21 at 8:18
1
1
Can you post the code here? Have you tried calling
mix do clean, compile
or just deleting the _build
directory? What else have you tried so far?– Sheharyar
Nov 20 at 20:06
Can you post the code here? Have you tried calling
mix do clean, compile
or just deleting the _build
directory? What else have you tried so far?– Sheharyar
Nov 20 at 20:06
It is hard to tell without knowing how phoenix endpoint is configured? is it in umbrella? what mix.exs file contents are? where _build folders are? especially in case of umbrella! what dependencies are added since some may fail silently? Did you add some code that depends on configuration? What version of phoenix and elixir u r using?
– Milan Jaric
Nov 21 at 8:18
It is hard to tell without knowing how phoenix endpoint is configured? is it in umbrella? what mix.exs file contents are? where _build folders are? especially in case of umbrella! what dependencies are added since some may fail silently? Did you add some code that depends on configuration? What version of phoenix and elixir u r using?
– Milan Jaric
Nov 21 at 8:18
add a comment |
1 Answer
1
active
oldest
votes
The test module was missing names as the Test
suffix. In other words the module that was tested was called MyApp.MyModule
and so did the module that was holding the tests.
If the module to be tested is named MyApp.MyModule
, the tests should lie in
MyApp.MyModuleTest
2
“the tests should lie inMyApp.MyModuleTest
”—the wording is inaccurate. The name of the test might be arbitrary (I useMyApp.MyModule.Test
for instance,) the only requirement it should not be the same as any of the existing modules.
– Aleksei Matiushkin
Nov 21 at 10:11
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53399465%2ffunction-a-b-c-1-is-undefined-or-private-when-running-mix-tests-but-not-in-con%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
The test module was missing names as the Test
suffix. In other words the module that was tested was called MyApp.MyModule
and so did the module that was holding the tests.
If the module to be tested is named MyApp.MyModule
, the tests should lie in
MyApp.MyModuleTest
2
“the tests should lie inMyApp.MyModuleTest
”—the wording is inaccurate. The name of the test might be arbitrary (I useMyApp.MyModule.Test
for instance,) the only requirement it should not be the same as any of the existing modules.
– Aleksei Matiushkin
Nov 21 at 10:11
add a comment |
The test module was missing names as the Test
suffix. In other words the module that was tested was called MyApp.MyModule
and so did the module that was holding the tests.
If the module to be tested is named MyApp.MyModule
, the tests should lie in
MyApp.MyModuleTest
2
“the tests should lie inMyApp.MyModuleTest
”—the wording is inaccurate. The name of the test might be arbitrary (I useMyApp.MyModule.Test
for instance,) the only requirement it should not be the same as any of the existing modules.
– Aleksei Matiushkin
Nov 21 at 10:11
add a comment |
The test module was missing names as the Test
suffix. In other words the module that was tested was called MyApp.MyModule
and so did the module that was holding the tests.
If the module to be tested is named MyApp.MyModule
, the tests should lie in
MyApp.MyModuleTest
The test module was missing names as the Test
suffix. In other words the module that was tested was called MyApp.MyModule
and so did the module that was holding the tests.
If the module to be tested is named MyApp.MyModule
, the tests should lie in
MyApp.MyModuleTest
answered Nov 21 at 9:48
David B.
182211
182211
2
“the tests should lie inMyApp.MyModuleTest
”—the wording is inaccurate. The name of the test might be arbitrary (I useMyApp.MyModule.Test
for instance,) the only requirement it should not be the same as any of the existing modules.
– Aleksei Matiushkin
Nov 21 at 10:11
add a comment |
2
“the tests should lie inMyApp.MyModuleTest
”—the wording is inaccurate. The name of the test might be arbitrary (I useMyApp.MyModule.Test
for instance,) the only requirement it should not be the same as any of the existing modules.
– Aleksei Matiushkin
Nov 21 at 10:11
2
2
“the tests should lie in
MyApp.MyModuleTest
”—the wording is inaccurate. The name of the test might be arbitrary (I use MyApp.MyModule.Test
for instance,) the only requirement it should not be the same as any of the existing modules.– Aleksei Matiushkin
Nov 21 at 10:11
“the tests should lie in
MyApp.MyModuleTest
”—the wording is inaccurate. The name of the test might be arbitrary (I use MyApp.MyModule.Test
for instance,) the only requirement it should not be the same as any of the existing modules.– Aleksei Matiushkin
Nov 21 at 10:11
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53399465%2ffunction-a-b-c-1-is-undefined-or-private-when-running-mix-tests-but-not-in-con%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Can you post the code here? Have you tried calling
mix do clean, compile
or just deleting the_build
directory? What else have you tried so far?– Sheharyar
Nov 20 at 20:06
It is hard to tell without knowing how phoenix endpoint is configured? is it in umbrella? what mix.exs file contents are? where _build folders are? especially in case of umbrella! what dependencies are added since some may fail silently? Did you add some code that depends on configuration? What version of phoenix and elixir u r using?
– Milan Jaric
Nov 21 at 8:18