-
-
Notifications
You must be signed in to change notification settings - Fork 968
Open
Description
Steps to Reproduce
Add config to application.groovy:
foobar.foo = "1"
foobar.bar = ["1"]
foobar.baz = ["1" : "1"]
baz = ["1" : "1"]
grails create-service Foo and add these tests:
@TestFor(FooService)
class FooServiceSpec extends Specification {
static doWithConfig(c) {
c.foobar.foo = "2"
c.foobar.bar = ["2"]
c.foobar.baz = ["2": "2"]
c.baz = ["2": "2"]
}
void "test string"() {
expect:
grailsApplication.config.foobar.foo == "2"
}
void "test list"() {
expect:
grailsApplication.config.foobar.bar == ["2"]
}
void "test map one level"() {
expect:
grailsApplication.config.baz == ["2": "2"]
}
void "test map two levels"() {
expect:
grailsApplication.config.foobar.baz == ["2": "2"]
}
}
Expected Behaviour
All tests should pass
Actual Behaviour
The test "test map two levels" fails:
grailsApplication.config.foobar.baz == ["2": "2"]
| | | | |
| | | | false
| | | [1:1, 2:2]
| | [foo:2, bar:[2], baz:[1:1, 2:2]]
Note that the test "test map one level" runs fine, which means there are differences based on how deep the property is nested.
Environment Information
- Operating System: OS X El Capitan
- Grails Version: 3.2.0
- JDK Version: 1.8.0_77
- Container Version (If Applicable):
Example Application
https://github.com/rlovtangen/bugreport-grails-core-doWithConfig