-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
35 lines (28 loc) · 895 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# frozen_string_literal: true
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 Zerocracy
# SPDX-License-Identifier: MIT
require 'rubygems'
require 'rake'
require 'rake/clean'
ENV['RACK_ENV'] = 'test'
task default: %i[clean test judges rubocop]
require 'rake/testtask'
desc 'Run all unit tests'
Rake::TestTask.new(:test) do |test|
require 'minitest/reporters'
Minitest::Reporters.use! [Minitest::Reporters::SpecReporter.new]
test.libs << 'lib' << 'test'
test.pattern = 'test/**/test_*.rb'
test.warning = true
test.verbose = false
end
desc 'Test all judges'
task :judges do
live = ARGV.include?('--live') ? '' : '--disable live'
sh "judges #{ARGV.include?('--verbose') ? '--verbose' : ''} test --no-log #{live} --lib lib judges"
end
require 'rubocop/rake_task'
desc 'Run RuboCop on all directories'
RuboCop::RakeTask.new(:rubocop) do |task|
task.fail_on_error = true
end