I don’t know of a simple example, but here’s a rough outline.
Create a subclass of TestResource, implementing setUp and tearDown as needed.
On the class side of your TestCase subclass(es), either implement a resources method that returns a collection containing your TestResource subclass, or implement a method with a <resource> pragma that returns your TestResource subclass.
In your test cases, you can get the singleton instance of your resource by sending #current to your TestResource subclass.
I have a vague memory of the pragma approach not quite working right. We have an override in our system that corrects for this in TestCase class>>allResources.
Hopefully, this is enough to get you started. If not, please ask a more specific question and I’ll try to help some more when I have time.
On Thu, Jan 30, 2014 at 10:05 AM, Jim Thompson <[hidden email]> wrote:
Is there a simple example of setting up a test case with a resource?
I'm missing something -- I can't believe it is this hard