Skip to content


Subversion checkout URL

You can clone with
Download ZIP
JavaScript Ruby
Fetching latest commit...
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Jasmine Testing Example

A very simple example of using jasmine for JavaScript testing and a couple of tools that make test driven development easier.

First Time Setup

  1. Install Homebrew

  2. Install git

    brew install git

  3. Install Qt

    brew install qt

  4. Install RVM

    Be sure to modify your shell rc file as instructed.

  5. Install ruby-1.9.2-p290

    rvm install ruby-1.9.2-p290

    rvm use ruby-1.9.2-p290

    ruby -v # should report "ruby 1.9.2p290..."

  6. Checkout the project

    git clone git://

  7. CD into project (and switch to the right ruby version and gemset)

    cd jasmine-testing-example

    Say yes to trusting the .rvmrc

  8. Install bundler

    gem install bundler --pre

  9. Install dependencies using bundler


Running the Tests from the Command Line

bundle exec jasmine-headless-webkit

Running the Tests in the Browser

TBD: the jasmine gem only provide a rake task (no jasmine command line) and it pulls in countless unnecessary dependencies.

Using Guard to Run Tests Whenever Something Changes

Guard will monitor changes to the js or the tests. When a change is detected, the tests are run automatically.

bundle exec guard

Make a change to the js or tests, watch guard do its thing. It'll notify via growl if it's installed. Press enter to manually kick off a test run.

Something went wrong with that request. Please try again.