From ecc46d69087b9246d368a3459f99fdd4cba43d97 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..4df50bb 100644 --- a/Rakefile +++ b/Rakefile @@ -10,3 +10,20 @@ namespace :gem do system 'gem build trollolo.gemspec' end end + +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 do |t| + t.options = ['--display-cop-names'] + end +end