Jasmine and Coffeescript Setup for Rails

As I started to write more javascript code in my rails app, it became obvious that I should be testing it ! I wanted to use jasmine and coffeescript. I searched a long time to find out what was the most common and supported setup for a rails app, so now I recommand

1
2
3
gem 'jasmine'
gem 'jasminerice'
gem 'guard-jasmine'
  • The jasmine gem is by far the most common jasmine gem, it is supported by Pivotal Labs so there is no fear of it being droped soon.
  • The guard-jasmin gem is supported by MKSoft, and is not only handling continuous phantomjs headless jasmine testing through guard, but it also provides command line and rake tools to run your jasmine specs during continuous integration.
  • Eventually, the jasminerice gem makes it easy to write your jasmine specs with coffeescript. It also wraps a version of jasmine-jquery to assist client javascript testing. Although there is a “looking for maintainer” message on the README page, there are some recent commits, so it seems that pull requests are still being merged even if the project is not actively developpped anymore … I belive volunteers are welcome.

All 3 have detailed and up to date setup and usage instructions.

Comments