Skip to content

Commit

Permalink
Spock spec for Config
Browse files Browse the repository at this point in the history
I implement the Spock specification for the Config class and fix some
issues.

Furthermore, I clean up the imports in ViewTagLibSpec.
  • Loading branch information
dellermann committed Jan 9, 2014
1 parent 9b475cd commit d07734b
Show file tree
Hide file tree
Showing 5 changed files with 422 additions and 99 deletions.
6 changes: 3 additions & 3 deletions application.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#Grails Metadata file
#Thu Jan 09 10:43:18 CET 2014
app.buildDate=2014-01-09T10\:43\:18+0100
app.buildNumber=5558
#Thu Jan 09 12:00:30 CET 2014
app.buildDate=2014-01-09T12\:00\:30+0100
app.buildNumber=5601
app.buildProfile=test
app.grails.version=2.3.4.BUILD-SNAPSHOT
app.name=GrailsUnitTestMixin
Expand Down
6 changes: 3 additions & 3 deletions grails-app/domain/org/amcworld/springcrm/Config.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ class Config {
Object asType(Class type) {
switch (type) {
case Date:
return Date.parseToStringDate(value)
return value ? Date.parseToStringDate(value) : null
case Calendar:
return Date.parseToStringDate(value).toCalendar()
return value ? Date.parseToStringDate(value).toCalendar() : null
case Boolean:
return (value == null) ? null : Boolean.valueOf(value)
default:
Expand All @@ -68,7 +68,7 @@ class Config {

@Override
int hashCode() {
name.hashCode()
(name ?: '').hashCode()
}

@Override
Expand Down
Loading

0 comments on commit d07734b

Please sign in to comment.