Re: [java-161] taglib testing

From: user 1.
Sent on: Tuesday, February 26, 2008 3:38 PM
Eric Lambrecht wrote:
> class SomeTagLibTest {
> 
>   def testDoIt {
>     def sw = new StringWriter();
>     def pw = new PrintWriter(sw);
> 
>     SomeTagLib.metaClass­.getOut << { -> out }

dammit - that should have been

	SomeTagLib.metaClass­.getOut << { -> pw }

I should have written a unit test before emailing this out. ;-)

Eric..





>     def tag = new SomeTagLib();
>     taglib.doit([:])
> 
>     assertEquals("foobar­!", sw.toString())
>   }
> 
> }
> 
> Understanding this has totally opened my eyes to how grails is doing a
> lot of things behind the scenes.
> 
> Eric...
> 
> 
> 
> 
> -- 
> Please Note: If you hit "REPLY", your message will be sent to everyone 
> on this mailing list ([address removed])
> http://java.meetu...­
> This message was sent by Eric Lambrecht ([address removed]) from SF Bay 
> Groovy and Grails Meetup Group.
> To learn more about Eric Lambrecht, visit his/her member profile: 
> http://java.meetu...­
> To unsubscribe or to update your mailing list settings, click here: 
> http://www.meetup...­
> 
> Meetup.com Customer Service: [address removed]
> 632 Broadway New York NY 10012 USA
> 

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy