Automatically run your Konacha tests through Guard.
Install the gem:
$ gem install guard-konacha
Or add to your Gemfile:
gem 'guard-konacha'
Add guard definitions to your Guardfile
guard :konacha do
watch(%r{^app/assets/javascripts/(.*)\.js(\.coffee)?$}) { |m| "#{m[1]}_spec.js" }
watch(%r{^spec/javascripts/.+_spec(\.js|\.js\.coffee)$})
end
If your specs live outside of spec/javascripts
then tell Konacha where to find them.
guard :konacha, :spec_dir => 'spec/front-end' do
# ...
end
If you want to use capybara-webkit instead of the default selenium driver:
require 'capybara-webkit'
guard :konacha, :driver => :webkit do
# ...
end
Or use Poltergeist:
require 'capybara/poltergeist'
guard :konacha, :driver => :poltergeist do
# ...
end
If you are running konacha:serve on a different host or port than the
default localhost
and 3500
, the configuration settings :host
and :port
will help you there.
This is a work in progress and could use some help.