a context for testing

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

a context for testing

Joel Turnbull
I have a PRWidget that initializes a report based on whether self
context user isNil. I'm attempting to do unit tests on the widget using
SeasideTesting, but when setUp initializes the widget, it has no
context. Is there a simple way to create a test context?

I don't quite understand the pieces of a context ( kernel, structure,
command ) well enough to create one from scratch at this point.

Joel


_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki

smime.p7s (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: a context for testing

Lukas Renggli
> I have a PRWidget that initializes a report based on whether self context
> user isNil. I'm attempting to do unit tests on the widget using
> SeasideTesting, but when setUp initializes the widget, it has no context. Is
> there a simple way to create a test context?

Have a look at the references to PRContext in Pier-Testing there are a
few examples.

For a basic example

   PRContext kernel: (PRKernel new root: (PRPage named: 'Root'))

should give you a valid context on a temporary kernel with a single root page.

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch

_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki