forked from ddnexus/pagy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
64 lines (53 loc) · 2.03 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
# encoding: utf-8
# frozen_string_literal: true
require "bundler/setup"
require "bundler/gem_tasks"
require "rake/testtask"
require "rubocop/rake_task" unless ENV['SKIP_RUBOCOP']
# The extras that override the built-in methods need to be tested in isolation in order
# to prevent them to change also the behavior and the result of the built-in tests.
# We exclude them from the :test_common task and create a new task for them, then added to the :default task
Rake::TestTask.new(:test_common) do |t|
t.libs << "test"
t.libs << "lib"
t.test_files = FileList.new.include("test/**/*_test.rb").exclude('test/**/i18n_test.rb', 'test/**/items_test.rb', 'test/**/overflow_test.rb', 'test/**/trim_test.rb', 'test/**/elasticsearch_rails_test.rb', 'test/**/searchkick_test.rb', 'test/**/support_test.rb')
end
Rake::TestTask.new(:test_extra_i18n) do |t|
t.libs << "test"
t.libs << "lib"
t.test_files = FileList['test/**/i18n_test.rb']
end
Rake::TestTask.new(:test_extra_items) do |t|
t.libs << "test"
t.libs << "lib"
t.test_files = FileList['test/**/items_test.rb']
end
Rake::TestTask.new(:test_extra_overflow) do |t|
t.libs << "test"
t.libs << "lib"
t.test_files = FileList['test/**/overflow_test.rb']
end
Rake::TestTask.new(:test_extra_trim) do |t|
t.libs << "test"
t.libs << "lib"
t.test_files = FileList['test/**/trim_test.rb']
end
Rake::TestTask.new(:test_extra_elasticsearch) do |t|
t.libs << "test"
t.libs << "lib"
t.test_files = FileList['test/**/elasticsearch_rails_test.rb', 'test/**/searchkick_test.rb']
end
Rake::TestTask.new(:test_support) do |t|
t.libs << "test"
t.libs << "lib"
t.test_files = FileList['test/**/support_test.rb']
end
task :test => [:test_common, :test_extra_items, :test_extra_i18n, :test_extra_overflow, :test_extra_trim, :test_extra_elasticsearch, :test_support ]
if ENV['SKIP_RUBOCOP']
task :default => [:test]
else
RuboCop::RakeTask.new(:rubocop) do |t|
t.options = `git ls-files -z`.split("\x0") # limit rubocop to the files in the repo
end
task :default => [:test, :rubocop]
end