[MacRuby-devel] Xcode Project Template with Testing Baked In

Dylan Bruzenak dylan at ideaswarm.com
Thu Oct 1 19:50:36 PDT 2009


Message is being held pending moderator approval; let me know if I should
post the actual file somewhere else :)

- Dylan

On Thu, Oct 1, 2009 at 9:48 PM, Dylan Bruzenak <dylan at ideaswarm.com> wrote:

> Good idea. I've attached it here. I may have accidentally added the build
> directory as well; this should be deleted from the template.
>
> To test you can copy it to one of the template directories such as :
> ~/Library/Application Support/Developer/Shared/Xcode/Project
> Templates/Application/MacRuby Application With Testing
>
> Differences:
>
> - Embed MacRuby target is included by default to easy deployment for first
> time users
> - Tests directory has been added for tests
> - test_stub.rb has been added with a starting test::unit case
> - Unit Tests target has been added to run the tests
> - test_suite.rb has been added to load up all tests from the Tests
> directory. This can easily be made recursive using Dir.glob.
>
> I've left out the framework/obj-c testing stuff because it is difficult to
> get it working in cases where there is no objective-c; building the
> framework requires at least one class. A better way to handle that would be
> to write up a blog post on how to do this; mainly:
>
> 1.) Create a new Cocoa -> Framework target
> 2.) add the new framework to your unit test and .app targets so that it
> gets built when either target is run
> 3.) add a copy files step, targeting frameworks, to your .app target
> 4.) add the new framework(drag from the products folder) to both the link
> and copy steps of your .app target to include it with your .app file
> 5.) add "framework 'newframeworkname'" to your rb_main.rb file
> 6.) add "framework 'build/Debug/newframeworkname.framework' to your
> test_suite.rb file
>
> After following these steps you can test any Obj-c classes added to the
> framework from Ruby, as well as any Ruby classes that depend on these custom
> classes.
>
> - Dylan
>
>
> On Thu, Oct 1, 2009 at 6:31 PM, Matt Aimonetti <mattaimonetti at gmail.com>wrote:
>
>> Hi Dylan,
>>
>> Why don't you you post your template so people can look at it and give
>> their feedback? People like Eloy would probably give their feedback ;)
>>
>> - Matt
>>
>>
>>
>> On Thu, Oct 1, 2009 at 4:26 PM, Dylan Bruzenak <dylan at ideaswarm.com>wrote:
>>
>>> So, I've been mucking about with MacRuby lately. It's been fun so far.
>>> Thanks to all the devs for this great project.
>>> I'm a pretty firm believer in unit testing my Ruby code. I love how Ruby
>>> on Rails and similar frameworks nudge you in the right direction by baking
>>> in an existing testing infrastructure.
>>>
>>> I've got testing pretty much figured out and was wondering if the team
>>> would be open to modifying the basic Xcode project template to add unit
>>> testing, with a stub test and test_suite file to get started. This would
>>> also involve creating a framework for any objective-c code that the user
>>> writes so that it can be included in both the .app and the test files.
>>>
>>> In addition it might be useful to include the 'embed mac ruby' and
>>> possibly a macrubyc target as well by default. These can always be removed
>>> if a user doesn't want them.
>>>
>>> I can supply preliminary patches if this seems like a good route to go.
>>>
>>> - Dylan Bruzenak
>>> www.ideaswarm.com
>>>
>>>
>>>
>>> _______________________________________________
>>> MacRuby-devel mailing list
>>> MacRuby-devel at lists.macosforge.org
>>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>>>
>>>
>>
>> _______________________________________________
>> MacRuby-devel mailing list
>> MacRuby-devel at lists.macosforge.org
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-devel/attachments/20091001/a12790ed/attachment.html>


More information about the MacRuby-devel mailing list