Projects

Ticket #362 (closed enhancement: fixed)

Opened 10 months ago

Last modified 10 months ago

Add Unit Testing and Embed MacRuby to Project Template

Reported by: dylan@… Owned by: eloy.de.enige@…
Priority: trivial Milestone:
Component: MacRuby Keywords:
Cc:

Description

I'm attaching a new version of the default project template.

To test you can copy it to one of the template directories such as : ~/Library/Application Support/Developer/Shared/Xcode/Project Templates/Application/

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.

Attachments

MacRuby Application With Testing.zip Download (99.6 KB) - added by dylan@… 10 months ago.
Project Template
MacRuby Application With Testing.2.zip Download (99.1 KB) - added by dylan@… 10 months ago.
MacRuby Application With Testing.3.zip Download (99.1 KB) - added by dylan@… 10 months ago.

Change History

Changed 10 months ago by dylan@…

Project Template

  Changed 10 months ago by dylan@…

If there's interest I can also port these changes to the other project templates.

  Changed 10 months ago by lsansonetti@…

I just gave it a try, it's awesome!

I think we should definitely port the changes to the other templates, but we may first want to go with the main one and iterate on it until we are good. It's always painful to manage Xcode templates so it may be easier if we port the changes all in once.

Also, regarding the test stuff, I think Eloy might want to comment, since he's our local test expert :)

  Changed 10 months ago by dylan@…

:)

Good idea on the wait to merge part. I do so hate replicating work.

I'm new to Ruby 1.9; looks like test::unit was pulled in favor of minitest and a thin interface layer wrapper around it to provide basic test::unit compatibility. I see a spec.rb in there as well; might be interesting to include a stub for that kind of test as well.

  Changed 10 months ago by eloy.de.enige@…

As commented on the ML, for now I'd say it can go in the template, but on the long run this should be replaced by Rucola's testing support. If you want to use specs, skip the minitest one, you're better of using Bacon.

in reply to: ↑ description   Changed 10 months ago by eloy.de.enige@…

  • priority changed from blocker to trivial
  • owner changed from lsansonetti@… to eloy.de.enige@…

Actually, after thinking about it a bit more, I'm still on the fence about adding it to the project templates now. Because A it doesn't work correctly yet and we would only be indicating to people that it is supported, which it isn't. And it might be weird for people that we add something and change it a month later… I personally don't have a big problem with the latter issue, but some might.

  Changed 10 months ago by eloy.de.enige@…

So, I was gonna apply it as Laurent already tried it and said it worked great, but I'd first like to run some stuff by you:

How about changing the test_suite.rb file to run_suite.rb, move it into the Tests dir and use glob like:

Dir.glob(File.expand_path('../**/*_test.rb', __FILE__)).each { |test| require test }

And rename the test_stub.rb to stub_test.rb.

So invoking the complete suite would be: $ ruby Tests/run_suite.rb

Thoughts?

Changed 10 months ago by dylan@…

  Changed 10 months ago by dylan@…

I like it. I've attached a version with the changes :)

Changed 10 months ago by dylan@…

  Changed 10 months ago by dylan@…

I was playing around with this a bit more and I noticed a bug in the template. Fix attached.

  Changed 10 months ago by eloy.de.enige@…

  • status changed from new to closed
  • resolution set to fixed

Thanks! Committed in r2723 & r2724. Please double check everything works as expected.

Note: See TracTickets for help on using tickets.