Skip to content

Instantly share code, notes, and snippets.

@frullah
Created July 30, 2020 19:02
Show Gist options
  • Save frullah/6579234c30ffd3142c8652632de36d86 to your computer and use it in GitHub Desktop.
Save frullah/6579234c30ffd3142c8652632de36d86 to your computer and use it in GitHub Desktop.
rails additional setup
group :development, :test do
gem 'guard-rspec', require: false
gem 'rspec-rails', '~> 4.0.1'
end
group :development do
gem 'rubocop', '~> 0.88.0', require: false
gem 'spring-commands-rspec'
gem 'spring-commands-rubocop'
end
group :test do
gem 'shoulda-matchers', '~> 4.0'
end
#!/bin/sh
bundle exec rails g rspec:install
bundle exec guard init
bundle exec binstub rubocop rspec
# replace rpsec command
sed -r '(?<=s/cmd: ")(.*)(?=")/bundle exec spring rspec -f doc/' Guardfile
# insert shoulda-matchers config to spec/rails_helper.rb
cat <<EOF >> spec/rails_helper.rb
Shoulda::Matchers.configure do |config|
config.integrate do |with|
with.test_framework :rspec
with.library :rails
end
end
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment