Details
-
Type:
Bug
-
Status:
Open
-
Resolution: Unresolved
-
Affects Version/s: 1.0-rc-3
-
Fix Version/s: None
Description
I have a unit test that load a resource using using ..class.getResource(). The resource is in the src/test/resources folder. When running the unit test using gradle it works as expected.
When I generate a idea module from my gradle file then the resource folder is added as a source folder and that seems fair. But when I run the unit test from within IntelliJ (a IntelliJ run configuration) then the test fails since src/test/resources is not in the module dependencies.
I have fixed it by doing this:
idea {
module {
scopes.TEST.plus+= configurations.detachedConfiguration(dependencies.create(files('src/test/resources')))
scopes.RUNTIME.plus+= configurations.detachedConfiguration(dependencies.create(files('src/main/resources')))
}
}
That will add the module dependencies that I need to run my test. It also fixes the similar problem for runtime dependencies.
I think the resources folders should be included as dependencies by default.