Created
November 25, 2024 17:11
-
-
Save eval/fdbb24af5eb953aa7fd2d12db0e2b27e to your computer and use it in GitHub Desktop.
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
# Skip generating default test framework | |
say "Creating a Rails application with rspec-rails" | |
inside 'config' do | |
inject_into_file 'application.rb', after: "class Application < Rails::Application\n" do | |
<<-RUBY | |
config.generators do |g| | |
#g.hide_namespace "test_unit" # uncomment to apply the workaround, ie see no test_unit generators | |
end | |
RUBY | |
end | |
end | |
# Add rspec-rails gem to the Gemfile | |
say "Adding rspec-rails gem..." | |
gem_group :development, :test do | |
gem 'rspec-rails', '~> 6.0' | |
end | |
# Run bundle install | |
say "Installing gems..." | |
run 'bundle install' | |
# Run rspec:install to set up RSpec | |
say "Setting up RSpec..." | |
generate 'rspec:install' | |
say "Rails application is ready with RSpec configured!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment