rpflorence/ember-qunit — pull request #44 by wbyoung (2014-04-24 01:52:12+00:00)
Title: Large step toward fixing #22

This is an attempt to put all Ember related logic into a single area, `builder.js` that could later be pulled out into its own JS library to address #22. I believe I've properly separated the correct pieces at this point.

I've left each of my individual commits at this point in case anyone would like to see individual steps that I took while refactoring this. I'll happily squash them if this pull request gets approved.

#### Notes

The names of the variables and functions that I added may not be the most logical as I don't really have a strong grasp of lower level concepts in Ember and QUnit yet. I used the term _builder_ as discussed on issue #22. And a builder creates _products_ which is what @stefanpenner referred to as a factory and instance pair.

The builder does a bit more than that for components and models. This has been pulled out of the previous delegate code from the `moduleForComponent` and `moduleForModel` functions.

In relation to the code pulled out of those two delegates, there are some slight ordering changes that may or may not have effects that I'm unaware of. Some Ember related code that was in the _component_ and _model_ delegates will be executed earlier now. It will now execute immediately after the Ember isolated container is set up rather than after the QUnit context is set up. All unit tests pass, so I don't think this is an issue, but it's the one change that is probably more than just moving chunks of code around.

#### Todo

The `builder.js` file should be renamed to something that makes a little more sense. We should document what each of those functions is doing pretty well, and encourage this to be used by a few other adapters that don't have this same functionality just yet.