-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
63 lines (52 loc) · 1.15 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
require 'bundler/gem_tasks'
require 'rspec/core/rake_task'
require 'rubocop/rake_task'
require 'rubocop'
require 'fileutils'
require 'rainbow'
require 'inch/rake'
namespace :spec do
desc 'Run all spec tests at once.'
RSpec::Core::RakeTask.new(:all)
desc 'Run unit spec tests.'
RSpec::Core::RakeTask.new(:unit) do |t|
t.pattern = [
'spec/unit'
]
end
desc 'Run integration spec tests.'
RSpec::Core::RakeTask.new(:integration) do |t|
t.pattern = [
'spec/integration'
]
end
end
Inch::Rake::Suggest.new :inch, '--pedantic'
RuboCop::RakeTask.new(:rubocop) do |task|
# don't abort rake on failure
task.fail_on_error = true
end
namespace :rubocop do
namespace :todo do
desc 'Cleans a rubocop TODO list'
task :clean do
File.write('.rubocop_todo.yml', '')
Rake::Task[:rubocop].execute
end
desc 'Saves actual rubocop state into TODO list'
task :save do
rcli = RuboCop::CLI.new
rcli.run ['--auto-gen-config']
end
end
end
tests = [
:'spec:all',
:rubocop,
:inch
]
desc 'Run lint, and all spec tests.'
task test: tests
desc 'test package'
task build: [:test]
task default: :test