forked from ISS-SOA/codepraise
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRakefile
73 lines (58 loc) · 1.3 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
# frozen_string_literal: true
require 'rake/testtask'
task :default do
puts `rake -T`
end
desc 'Run unit and integration tests'
Rake::TestTask.new(:spec) do |t|
t.pattern = 'spec/**/*_spec.rb'
t.warning = false
end
desc 'Run acceptance tests'
# NOTE: run `rake run:test` in another process
Rake::TestTask.new(:spec_accept) do |t|
t.pattern = 'spec/tests_acceptance/*_acceptance.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 'Keep restarting web app upon changes'
task :rerack do
sh "rerun -c rackup --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
desc 'Run application console (pry)'
task :console do
sh 'pry -r ./init.rb'
end
namespace :vcr do
desc 'delete cassette fixtures'
task :wipe do
sh 'rm spec/fixtures/cassettes/*.yml' do |ok, _|
puts(ok ? 'Cassettes deleted' : 'No cassettes found')
end
end
end
namespace :quality do
CODE = 'app/'
desc 'run all quality checks'
task :all => [:rubocop, :reek, :flog]
task :rubocop do
sh 'rubocop'
end
task :reek do
sh "reek #{CODE}"
end
task :flog do
sh "flog #{CODE}"
end
end