Using during Hartl rails 4.0 guide (http://ruby.railstutorial.org/chapters)
group :development, :test
gem 'guard-rspec'
gem 'guard-livereload'
gem 'spork-rails', github: 'sporkrb/spork-rails' # RubyGems.org nog uptodate
gem 'guard-spork'
gem 'childprocess'
end
group :test do
gem 'selenium-webdriver', '2.0.0'
gem 'capybara', '2.1.0'
gem 'factory_girl_rails'
gem 'cucumber', '1.2.5' # Spork not supported as of Cucumber 1.3.0, need to use 1.2.5
gem 'cucumber-rails', :require => false
gem 'database_cleaner'
end
$ bundle install
$ rails generate rspec:install
$ bundle guard init rspec
Edit guard file, change to: (/Guardfile)
guard 'rspec', after_all_pass: false, cli: '--drb' do
$ bundle spork --bootstrap
Edit spec file, to set up spork: (/spec/spec_helper.rb)
Spork.prefork do
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'rspec/autorun'
.
.
.
RSpec.configure do |config|
.
.
.
end
end
$ bundle guard init spork
Now you can start guard with spork (but don't do it, Cucumber is still to go)
$ bundle guard
Install Cucumber
$ rails generate cucumber:install --spork
Done!
$ bundle cucumber