maccman/spine — pull request #363 by metaskills (2012-08-15 10:55:31+00:00)
Title: jQuery Test Improvements. Cake is not a lie! :cake: :cake: :cake:

Endow Cakefile with the ability to run tests using `$ cake test`. The Cakefile now also can test 3 different jQuery versions. The default is jQuery 1.8 when running the standard test task. However, there are tasks to focus specifically on jQuery 1.7 or 1.6 too. There is also a task to run them all. Additional tasks:

```
cake test # Run Jasmine specs using PhantomJS
cake test:all # Run tests using all jQuery versions
cake test:jquery18 # Run tests using jQuery 1.8
cake test:jquery17 # Run tests using jQuery 1.7
cake test:jquery16 # Run tests using jQuery 1.6
```

I have changed the Travis setup to run `cake test:all` while keeping the package.json focused on `cake test`. These can be easily changed and seemed like a logical start. I personally really like that `cake test` is not the full gauntlet too.

While implementing this I decided to focus on jQuery MAJOR.MINOR version numbers. This will keep the Cakefile from needing to be edited as jQuery releases TINY updates. So when jQuery 1.8.x comes out, simply paste it into the 1.8 file.

A few key features of the way I setup the Cakefile include:

* Symliking a jquery-x.x.js version to jquery.js before runnign tests and making sure that in case of errors we maintain the latest base jquery symlink after any run.

* Most important, the exit code of either a focused or full run of the parent processed is updated if any of the child test processes do not return succesfully. So this means that when Travis runs any test, focused or full, it will get a good/failed status code to work off of.

WARNING: This will break the build as there are currently a few test failures in jQuery 1.8. I did not want to have this commit address thoses, just put a system in place to make testing them all easy. Here is the current output if you are curious. https://gist.github.com/3358679

NOTICE: This is the first time I ever looked at a Cakefile and written any Node.js code. I tried follow some best practices while learning and hope it measures up. If not, let me know and I am willing to learn and update any code.

Cake is not a lie! :cake: :cake: :cake: