Re: OCUnit and main bundle
Re: OCUnit and main bundle
- Subject: Re: OCUnit and main bundle
- From: Tim Hart <email@hidden>
- Date: Thu, 17 Feb 2005 10:48:48 -0600
I don't' know how OCUnit's test frameworks are put together, but I imagine they are similar to TestKit's.
I had a similar problem with a test I was writing with TestKit, and determined that in my case it was more 'correct' to call
[NSBundle bundleForClass:[self class]];
than to look for the main bundle.
In my case, I realized that I wanted to pair the resource (the plist) with whatever bundle the class itself was compiled in - not the main bundle of the application.
On Thursday, February 17, 2005, at 10:16AM, Giuseppe Alletti <email@hidden> wrote:
>I have a project with two targets:
>1 - PageViewEditor, wich is the Cocoa app.
>2 - PageViewEditorTest, wich is a testing framework created with OCUnit.
>
>In the first target, I have a class that initializes a static variable
>with the content of a plist file. The path to the plist file is
>determined via [[NSBundle mainBundle] pathForResource:@"filename"
>ofType:@"plist"]
>
>When I use the class in the testing framework, the plist file is not
>found, since the path to mainBundle results to be /Developer/Tools.
>
>The testing framework is set to execute test cases at build time, via
>the Shell Script build phase created automatically by the target
>template.
>
>Is there a way to force the testing framework to resolve correctly the
>mainBundle path? Or otherwise is there a way to make my class read the
>right file differently?
>
>Thank you,
>-----------------------
>Giuseppe Alletti
> _______________________________________________
>Do not post admin requests to the list. They will be ignored.
>Cocoa-dev mailing list (email@hidden)
>Help/Unsubscribe/Update your Subscription:
>
>This email sent to email@hidden
>
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden