Grails unit testing custom codec using Spock -


i'd create spock unit test test custom codec created. of examples see test custom codecs extending grailsunittestcase this. can point me in right direction on how using spock?

i ended doing following:

@testmixin(grailsunittestmixin) class securecodecspec extends specification {     def setup() {         grailsapplication.config.acme.encryption.password = 'topsecret'         mockcodec(securecodec)     }      @unroll     def "securecodec string value #original encodes , decodes properly"() {         when:         def encoded = original.encodeassecure()         def decoded = encoded.decodesecure()          then:         original != encoded         encoded != decoded         original == decoded          where:         original | _         'secret' | _         ''       | _     } 

}


Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -