Support for running JS tests and specs under env.js and browsers. jazz cooperates with wake and envjs to track dependences for incremental build and test.
You can install the gem via gem install smparkes-jazz. If you want to install from github (github.com/smparkes/jazz), you'll need to checkout the Jasmine submodule (git submodule update --init) and also need to make sure you have the prerequisites listed in the gemspec in the Rakefile. rake gemspec will then build and copy the necessary parts of Jasmine.
If you want to run the examples/tests, you'll need jQuery. The git submodule update --init command will have brought in jQuery, but you'll need to build it: cd vendor/jquery && make.
Even if you install the gem, you may want to get the github files to see and run the examples.
From the root of a project, i.e., the parent of the spec directory, you can use the jazz command as you would the rspec spec command, e.g.,
jazz spec/foo_spec.js spec/bar_spec.js
You can also execute HTML specs via jazz:
or even normal pages, that have the proper hooks to run as examples (see below).
HTML files must be valid XML, i.e., XHTML, at this time.
The HTML fixture must load the necessary test files. Any number of fixtures can be passed to the jazz command.
The Jasmine tests are configured to report results in streaming XML (JUnit format, more or less), which jazz turns into the familiar rspec format. The --xml flag causes jazz to display the raw XML output.
To run all the tests in the spec directory repeatedly you can use wake:
See jazz's Wakefile file and the discussion on examples below.
You can also try using autojaz as you would use autospec:
You'll need to install the ZenTest gem if you don't have it installed; jazz can be used without ZenTest installed, but autojaz cannot be. Note that autojaz may be deprecated in favor of wake.
Screen shot at www.scrnshots.com/users/smparkes/screenshots/206033
There are examples in examples/* and spec/examples/*. You can run the tests with rake test which will run wake against the Wakefile. (Wake as a runner will probably replace autojaz.) You'll need the wake gem.
You can also load the individual HTML files in the browser to run the tests there. For example, on a Mac, open example/hello_world.html. (The idea is that for production, the spec helper files are changed to not load the tests: that should be the only change necessary. Or the <script> tag could be ripped out.) Note that to run the tests from the filesystem in Firefox, you'll need to set the security.fileuri.strict_origin_policy option to true.
Pass dependence flag to envjsrb to support wake dependences
Add wake support
Support multiple fixtures on the jazz command. (Actually, this is entirely due to envjsrb supporting multiple fixtures. You need a recent build from github or an smparkes-envjs gem version of at least 0.0.5.)
Things to do
Complete and test support for loading against an HTTP server.
Focus on failing tests until fixed, a la autotest.
Extend to more frameworks, e.g., qunit. There's little here that's actually Jasmine-specific.
Including a missing script should be an error
Make work in interactive mode (requires intro/outro/out:blank intergration with envjsrb)
Copyright © 2009 Steven Parkes. See LICENSE for details.