« Return to Thread: [ANN] Testing Plugin 0.2 sneakily released

Re: [ANN] Testing Plugin 0.2 sneakily released

by Peter Ledbrook-2 :: Rate this Message:

Reply to Author | View in Thread

Quickly following on, there is now a 0.3 release :)

* Fixes a bug in ControllerUnitTestCase
* Supports "withFormat" in controllers
* Basic support for testing tag libraries, through the new TagLibUnitTestCase

The TagLibUnitTestCase adds an "out"property to the tag, which you can
access and call toString() on to get the content written to the output
writer. It also has support for the render tag - simply check the
"renderArgs" property to find out whether it was called with the right
arguments.

Just thought, if you call "render" more than once in a tag, this won't
work. For other tags, you will need to do something like:

  def tagLibControl = mockFor(MyTagLib)
  tagLibControl.demand.link(1..1) { ... }

  def tagLib = new MyTagLib()
  tagLib.myTag([:])

In other words, you'll have to mock the tag method calls. It supports
the "g." prefix, but not custom namespaces yet. Any ideas welcome.

Cheers,

Peter

--
Software Engineer
G2One, Inc.
http://www.g2one.com/

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


 « Return to Thread: [ANN] Testing Plugin 0.2 sneakily released