Skip to content

christiannelson/jasmine-testing-example

Repository files navigation

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

    http://mxcl.github.com/homebrew/

  2. Install git

    brew install git

  3. Install Qt

    brew install qt

  4. Install RVM

    http://beginrescueend.com/

    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://github.com/christiannelson/jasmine-testing-example.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

    bundle

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published