Every repository with this icon (
Every repository with this icon (
tree 1d3c0490ec26cd620c2e98defaddb7032e36d0f6
parent afe174ba7df873ce7cde9078e5aabe0d277554ee
| name | age | message | |
|---|---|---|---|
| |
MIT-LICENSE | Tue Jun 09 05:29:40 -0700 2009 | |
| |
README.textile | Tue Jun 09 06:20:40 -0700 2009 | |
| |
Rakefile | Mon Jun 08 07:02:45 -0700 2009 | |
| |
bin/ | Tue Jun 09 06:29:25 -0700 2009 | |
| |
hanoi.gemspec | Tue Jun 09 06:29:25 -0700 2009 | |
| |
lib/ | Sat Oct 31 11:28:42 -0700 2009 | |
| |
spec/ | Mon Jun 08 08:12:04 -0700 2009 | |
| |
templates/ | Tue Jun 09 05:51:48 -0700 2009 |
Automated jQuery tests with QUnit
Installation
(sudo) gem install jodosha-hanoi -s http://gems.github.comCrash Course
hanoi # prepare the target directory rake test:js # run the testsHow To Use
Prepare the target directory, you can use one of the following options:
hanoi hanoi . hanoi /path/to/projectYou need a valid Rake installation to run your tests:
rake test:jsYou can specify to run the test against one or more browsers:
rake test:js BROWSERS=firefox,ie,safariYou can specify to run only certain tests:
rake test:js TESTS=path/to/first_test.js,path/to/second_test.jsYou can combine both BROWSERS and TESTS configurations.
Structure
The hanoi executable will create the following structure:
Rakefilecreates a fresh rakefile, you have to edit it according to your setuptestHanoi creates it if missing, otherwise will choose between existingtestorspecpathsjavascriptis the root directory of your testsassetscontains the jQuery and QUnit source file and a css.
Place your assets in this directory, it’s mapped as root path/.example_test.jsis a sample of a real test case.templatescontains the template file for your tests. You shouldn’t edit it, if you don’t know the risk.fixturescontains all the HTML fixtures, each file will be injected into the proper case.
By convention, your test/javascript folder should reflect the structure of your source directory,
appending the _test.js suffix to each test case and the _fixtures.html to each fixture file.
Example:
src/ directory_a/ directory_b/ file_3.js file_2.js file_1.js test/ javascript/ directory_a/ directory_b/ file_3_test.js file_2_test.js file_1_test.js fixtures/ directory_a/ directory_b/ file_3_fixtures.html file_1_fixtures.htmlYou have probably noticed that file_2_fixtures.html is missing, this because fixtures are optional.
Browsers & Platforms
Platforms:
- MacOS
- Windows
- Linux
Browsers:
- Firefox
- Safari
- Internet Explorer
- Opera
- Konqueror
Acknowledgements
The Ruby libraries of Hanoi are a customization of the jsblib.rb, courtesy of the Prototype team.
Hanoi runs a customized version of QUnit, courtesy of the jQuery team.
Repository
git clone git://github.com/jodosha/hanoi.gitCopyright
© 2009 Luca Guidi – http://lucaguidi.com, released under the MIT license







