Assume you have, like I did, a ruby gem that contains some javascript you want to test standalone. First you need to install the jasmine-gem. You have two options:
Gemfile
, which jeweler parses to populate my gemspec with. Personally I find this much easier, and my workflow is much closer to any ruby development for me, this wayIf you have a rails-project, starting with jasmine is easy, and takes three easy steps:
# first add jasmine to Gemfile, and then
bundle install
rails g jasmine:install
rake jasmine
Inside your gem or simple ruby-project it is equally simple, just type
jasmine init
rake jasmine
Now you can need to edit the jasmine.yml
to make sure it is running your tests and your code, instead of the example code. In my case I had to change only one line:
src_files: - app/assets/javascripts/\*\*/\*.js
Happy testing :) Some interesting links to help you with jasmine:
Comments
Add comment