
Untitled
By: a guest on
Aug 1st, 2012 | syntax:
None | size: 0.62 KB | hits: 9 | expires: Never
Why tag lib test throws GrailsTagException?
class MyTagLib {
def something = {attrs, body ->
def format = new FormatTagLib()
out << format.formatDate(attrs.date, format: 'HH:mm')
}
}
class MyTagLibTests extends TagLibUnitTestCase {
//setUp() and tearDown() ommited
void testMyTagLib() {
tagLib = new MyTagLib()
tagLib.something(date: Date.parse('20/04/2012 08:00','dd/MM/yyyy HH:mm'))
assertEquals('08:00', out.toString()) //out is mocked...
}
}
org.codehaus.groovy.grails.web.taglib.exceptions.GrailsTagException: Tag [formatDate] does not exist. No corresponding tag library found.