-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathRakefile
60 lines (49 loc) · 1.44 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
# frozen_string_literal: true
require 'rake/testtask'
require 'rubocop/rake_task'
require 'reek/rake/task'
Rake::TestTask.new do |t|
t.name = 'test:page'
t.warning = true
t.description = 'Run "Page" tests'
t.test_files = FileList['t/page/*.rb', 't/helpers/*.rb']
t.libs << 't'
end
Rake::TestTask.new do |t|
t.name = 'test:web'
t.warning = false
t.verbose = true
t.description = 'Run "Web" tests (slow)'
t.test_files = FileList['t/web/**/*.rb']
t.libs << 't'
end
Rake::TestTask.new do |t|
t.name = 'test:extensions'
t.warning = false
t.verbose = true
t.description = 'Run "Everypolitician extensions" tests'
t.test_files = FileList['t/everypolitician_extensions/**/*.rb']
t.libs << 't'
end
Rake::TestTask.new do |t|
t.warning = false
t.verbose = true
t.description = 'Run all tests (slow)'
t.test_files = FileList['t/**/*.rb']
t.libs << 't'
end
RuboCop::RakeTask.new
Reek::Rake::Task.new do |t|
t.source_files = FileList['**/*.rb']
t.verbose = false
t.fail_on_error = true
end
task 'everypolitician-data', [:path] do |_, args|
fixture_path = Pathname.new(File.join('t/fixtures/everypolitician-data', args[:path]))
mkdir_p(fixture_path.dirname)
fixture_path.write(open("https://cdn.rawgit.com/everypolitician/everypolitician-data/#{args[:path]}").read)
end
# Check for known vulnerabilities in Gemfile.lock
require 'bundler/audit/task'
Bundler::Audit::Task.new
task default: ['test', 'rubocop', 'bundle:audit']