Search code examples
ruby-on-railsrspecrakerakefile

How to run default rake tasks in Rails 5?


Here's a layup for someone...

Back in Rails <= 4 days we'd run our test suite by simply typing $ rake at the command line, thanks to defaults in Rakefile:

task default: [:rubocop, :spec, :teaspoon]

but in Rails 5 it's not so apparent how to run default rake tasks now that rake has been replaced by rails. rails alone gives a list of possible commands rails responds to but doesn't run the specs. rails test seems logical but it tries to run minitest which we don't use. rails spec will run Rspec but not teaspoon or rubocop.

Where did this go? And why is something so apparently simple so hard for me to look up myself?


Solution

  • rails default executes those tasks for me on Rails 5.2.1, though I couldn't find it documented anywhere.