From 4de2f5fc2a8faf48d0b26d11b5f9a5c013825d09 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 --- .ruby-version | 1 + Rakefile | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 .ruby-version diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..197c4d5 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +2.4.0 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