[Seaside] [XHTML] WAFormTag>>before

Boris Popov boris at deepcovelabs.com
Thu Mar 29 16:08:32 UTC 2007


Michel,

All looks good so far. One quick comment about test cases, however, is
that what I ended up doing here is slightly different. Instead of
subclassing a specific testcase to do rendering passes, I pepper
existing test cases with rendering checks whenever I care to do it.
Here's a drill,

c := MyComponent new.
self assertString: (self render: c) equals: '<a
href="&amp;1">200.00</a>'

where,

TestCase>>render: aComponent
 | html |
 html := WARenderCanvas empty.
 aComponent renderContentOn: html.
 ^html contents

You could even refactor that down to,

self assertRender: c equals: '<a href="&amp;1">200.00</a>'

where,

TestCase>>assertRender: aComponent equals: aString
 | html |
 html := WARenderCanvas empty.
 aComponent renderContentOn: html.
 self assertString: html contents equals: aString

and,

TestCase>>assertString: a equals: b
 a = b ifFalse: [(Differator newOn: a and: b) open].
 self assert: a = b

Other reasons for not using the new WARenderCanvasTestCase would have be
the fact that we have our own hierarchy under SUnitToo's TestCase, not
SUnit's and we have different canvas renderers for different purposes
and specialized WARenderCanvasForTest doesn't play well there either.
But perhaps that's all because we already have baggage to carry, perhaps
new users wouldn't need to worry themselves with such obstructions,
although I still think being able to add rendering tests anywhere in our
test case hierarchy is greatly encouraging me to write more tests.

Cheers!

-Boris

-- 
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5
http://tinyurl.com/r7uw4

boris at deepcovelabs.com

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.

> -----Original Message-----
> From: seaside-bounces at lists.squeakfoundation.org [mailto:seaside-
> bounces at lists.squeakfoundation.org] On Behalf Of Michel Bany
> Sent: Thursday, March 29, 2007 8:31 AM
> To: Seaside - general discussion
> Subject: Re: [Seaside] [XHTML] WAFormTag>>before
> 
> 
> 
> 	I'm currently working on integrating your fix(es) into 2.6b1 and
> 2.7a1, then propagate them to VW 7.5 and to Store.
> 	Here is the list
> 	- renamed variables so that 2.7a1 can be loaded
> 	- #setSelectionFrom:to: added to textarea tag (canvas)
> 	- multi selection support for the select tag (classic)
> 	- unit tests for html production (canvas)
> 	- Boris Popov fix to the form tag (canvas)
> 	- Boris Popov fixes to the select tag (canvas) :
> 	-- enablement block
> 	-- ensure only one item marked as selected
> 	Might be ready tomorrow,
> 
> 
> 
> Hi Boris,
> I just published 2.6b1.135.0 with your fixes integrated.
> While at it, I also integrated an implementation for your unit test
ideas.
> ( http://lists.squeakfoundation.org/pipermail/seaside/2007-
> February/010820.html )
> See WARenderCanvasTestCase, subclasses are unit test examples.
> Let me know if you find any mistake or omission.
> Thanks,
> Michel.
> 
> 
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: WARenderCanvas class-empty.st
Type: application/octet-stream
Size: 674 bytes
Desc: WARenderCanvas class-empty.st
Url : http://lists.squeakfoundation.org/pipermail/seaside/attachments/20070329/afeccf56/WARenderCanvasclass-empty.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: WAHtmlStreamDocument-body.st
Type: application/octet-stream
Size: 345 bytes
Desc: WAHtmlStreamDocument-body.st
Url : http://lists.squeakfoundation.org/pipermail/seaside/attachments/20070329/afeccf56/WAHtmlStreamDocument-body.obj


More information about the seaside mailing list