This is a simple gem which integrates Karma with Rails
You will need npm to install karma so if you don't have node you can get it here
Add this line to your application's Gemfile:
gem 'rails_karma'
Then execute:
$ bundle
$ rake karma:install
This will install a sample config file in config/karma.conf.js and install karma via npm
If you are using travis you will need npm install
in your before_script to install karma e.g.
#sample .travis.yml file
language: ruby
env:
- DB=postgres
rvm:
- 2.0.0
bundler_args: --without development
before_script:
- cp config/database.yml.travis config/database.yml
- bundle exec rake db:setup
- npm install
and then you can use karma in your rake task e.g.
#lib/tasks/ci.rake
desc "Run all the tests, called by the CI server"
task :ci => [:spec, :cucumber, :karma] do
end
Update config/karma.conf.js to load the files you want to test and run rake karma
to run your tests
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
- adding angularjs-rails-resource
- adding test spec so rake karma works straight after install
- fixing error with shell command installing karma
- initial release