-
Notifications
You must be signed in to change notification settings - Fork 19
/
rakefile
55 lines (46 loc) · 1.29 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
# frozen_string_literal: true
require "dotenv/tasks"
require "rake/testtask"
require "rubocop/rake_task"
task default: %w[def]
RuboCop::RakeTask.new
namespace :test do
Rake::TestTask.new do |t|
t.name = "unit"
t.description = "Run unit tests"
t.libs << "test"
t.test_files = FileList["test/unit/*.rb"]
t.verbose = true
t.warning = true
t.deps = [:rubocop]
end
Rake::TestTask.new do |t|
t.name = "integration"
t.description = "Run integration tests (put credentials in a .env file)"
t.libs << "test"
t.test_files = FileList["test/integration/*.rb"]
t.verbose = true
t.warning = true
t.deps = %i[dotenv rubocop]
end
Rake::TestTask.new do |t|
t.name = "appveyor_status"
t.description = "Checks to ensure that AppVeyor tests pass before deploying from Travis"
t.libs << "test"
t.test_files = FileList["test/appveyor_status.rb"]
t.verbose = false
t.warning = false
end
end
desc "Run unit & integration tests"
task :test do
Rake::Task["test:unit"].invoke
Rake::Task["test:integration"].invoke
end
desc "Run tests and generate a code coverage report"
task :coverage do
ENV["COVERAGE"] = "true" if ENV["TRAVIS_RUBY_VERSION"] == "2.5.1" || ENV["CI"].nil?
Rake::Task["test"].execute
end
task def: %i[coverage] do
end