-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRakefile
74 lines (58 loc) · 1.32 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# frozen_string_literal: true
require 'rake/testtask'
CODE = 'lib/'
task :default do
puts `rake -T`
end
desc 'Run application console (irb)'
task :console do
sh 'pry -r ./init.rb'
end
desc 'Run unit and integration tests'
Rake::TestTask.new(:spec) do |t|
t.pattern = 'spec/tests/{integration,unit}/**/*_spec.rb'
t.warning = false
end
desc 'Run all tests'
Rake::TestTask.new(:spec_all) do |t|
t.pattern = 'spec/tests/**/*_spec.rb'
t.warning = false
end
desc 'Keep rerunning unit/integration tests upon changes'
task :respec do
sh "rerun -c 'rake spec' --ignore 'coverage/*'"
end
desc 'Run acceptance tests'
Rake::TestTask.new(:spec_accept) do |t|
t.pattern = 'spec/tests/acceptance/*_spec.rb'
t.warning = false
end
desc 'Keep restarting web app upon changes'
task :rerack do
sh "rerun -c 'rackup -p 9292' --ignore 'coverage/*'"
end
namespace :run do
task :dev do
sh 'rerun -c "rackup -p 9292"'
end
task :test do
sh 'RACK_ENV=test rackup -p 9000'
end
end
namespace :quality do
only_app = 'config/ app/'
desc 'run all static-analysis quality checks'
task all: %i[rubocop flog reek]
desc 'code style linter'
task :rubocop do
sh 'rubocop'
end
desc 'code smell detector'
task :reek do
sh 'reek'
end
desc 'complexiy analysis'
task :flog do
sh "flog -m #{only_app}"
end
end