From 0763d36138d1d5e0b02aff35a27262dc247cade8 Mon Sep 17 00:00:00 2001 From: rahul2240 Date: Fri, 16 Feb 2018 22:11:19 +0530 Subject: [PATCH] Add rake task for style and tests Instead of remembering all the commands it would be nice to have rake task to run tests and style checkers closes https://github.com/openSUSE/trollolo/issues/164 --- Rakefile | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Rakefile b/Rakefile index 5e63157..d3d0dfa 100644 --- a/Rakefile +++ b/Rakefile @@ -10,3 +10,20 @@ namespace :gem do system 'gem build trollolo.gemspec' end end + +# rake task for rspec and rubocop +# rake -T (for rake tasks) +require 'rubocop/rake_task' +require 'rspec/core/rake_task' + +task default: %i[rubocop spec] + +desc 'Run tests' +task :spec do + RSpec::Core::RakeTask.new +end + +desc 'Run rubocop' +task :rubocop do + RuboCop::RakeTask.new +end