Created
July 30, 2020 19:02
-
-
Save frullah/6579234c30ffd3142c8652632de36d86 to your computer and use it in GitHub Desktop.
rails additional setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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