“Because QUnit is just really simple.”
Everqueen is a serious fork of Evergreen by Jonas Nicklas. Evergreen rocks, but we wanted to use QUnit instead of Jasmine, and use Sprockets for serving up test files instead of the homebrew require system in Evergreen. Thank Jonas for his awesome OSS work on Evergreen, because he took us 99% of the way there.
Install as a Ruby gem:
gem install everqueen
You can require files from the public directory inside your test file:
You can now look at your test files inside a browser by starting up the Everqueen server:
Alternatively you can run the tests headlessly by running:
Add Everqueen to your Gemfile:
gem 'everqueen', :require => 'everqueen/rails'
Start your rails application and navigate to /everqueen. You should now see a list of all test files, click on one to run it.
There's a rake task provided for you that you can use to run your tests:
Add the following line to your Rakefile:
By default, Everqueen uses Selenium to run your tests and assumes a certain directory structure. If this standard is fine for you, then you don't need to do anything else. If you need to configure Everqueen to suit your needs, Everqueen will automatically look for and load the following files:
config/everqueen.rb .everqueen ~/.everqueen
The content of these files could look like this:
require 'capybara-webkit' Everqueen.configure do |config| config.driver = :webkit config.public_dir = 'public_html' config.test_dir = 'test' end
If you add a test_helper file like so:
It will automatically be loaded. This is a great place for adding custom matchers and the like.
Everqueen supports tests written in CoffeeScript via Sprockets. Just name your test file _test.coffee and it will automatically be translated for you.
You can also add a CoffeeScript test helper, but remember that CoffeeScript encloses individual files in a closure, if you need something you define in the test helper to be available in your test files, attach it to the window object:
If you plan to work on Everqueen, you need to checkout the QUnit library, which is added as a git submodule. Run the following command:
git submodule update --init
If you're using a version of Everqueen from git with bundler, you need to tell bundler to use submodules, this can be achieved with the following command:
gem 'everqueen', :submodules => true, :git => 'git://github.com/jnicklas/everqueen.git'
(The MIT License)
Copyright © 2009 Jonas Nicklas
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.