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

Laurent Sansonetti lsansonetti at apple.com
Thu Oct 1 23:26:39 PDT 2009


Hi Dylan,

Ideally it would be awesome to have some documentation on the website  
(likely a tutorial):

http://www.macruby.org/documentation.html

The process of creating a website article is not trivial but Mike  
Sassak recently contributed a tutorial describing how to contribute to  
the website:

http://www.macruby.org/documentation/website-contributions.html

Laurent

On Oct 1, 2009, at 11:06 PM, Dylan Bruzenak wrote:

> Just opened https://www.macruby.org/trac/ticket/362 :)
>
> As for the testing obj-c classes part, what is the best way to  
> document that ? I'm not the best blogger in the world but I could  
> write something up on my personal blog or contribute a short how to  
> somewhere in the documentation or your website if that is preferred.
>
> - Dylan
>
> On Thu, Oct 1, 2009 at 11:07 PM, Laurent Sansonetti <lsansonetti at apple.com 
> > wrote:
> Hi Dylan,
>
> Could you open a trac ticket and attach your new template there? It  
> would be a better idea I guess, and we can also track its inclusion  
> to trunk from there.
>
> Thanks for the work, it looks great :)
>
> Laurent
>
>
> On Oct 1, 2009, at 7:50 PM, Dylan Bruzenak wrote:
>
> 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
>
>
>
> _______________________________________________
> 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
>
> _______________________________________________
> MacRuby-devel mailing list
> MacRuby-devel at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel



More information about the MacRuby-devel mailing list