forked from ddnexus/pagy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
46 lines (37 loc) · 1.43 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
require "bundler/setup"
require "bundler/gem_tasks"
require "rake/testtask"
require "rubocop/rake_task"
# 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')
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
task :test => [:test_common, :test_extra_items, :test_extra_i18n, :test_extra_overflow, :test_extra_trim ]
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]