-
Notifications
You must be signed in to change notification settings - Fork 169
/
other_tasks.erb
86 lines (79 loc) · 2.17 KB
/
other_tasks.erb
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
74
75
76
77
78
79
80
81
82
83
84
85
86
<% case testing_framework %>
<% when :rspec %>
require 'spec/rake/spectask'
Spec::Rake::SpecTask.new(:<%= test_task %>) do |<%= test_task %>|
<%= test_task %>.libs << 'lib' << '<%= test_dir %>'
<%= test_task %>.spec_files = FileList['<%= test_pattern %>']
end
<% when :micronaut %>
require 'micronaut/rake_task'
Micronaut::RakeTask.new(:<%= test_task %>) do |<%= test_task %>|
<%= test_task %>.pattern = '<%= test_pattern %>'
<%= test_task %>.ruby_opts << '-Ilib -I<%= test_dir %>'
end
<% when :shindo %>
require 'shindo/rake'
Shindo::Rake.new
<% else %>
require 'rake/testtask'
Rake::TestTask.new(:<%= test_task %>) do |<%= test_task %>|
<%= test_task %>.libs << 'lib' << '<%= test_dir %>'
<%= test_task %>.pattern = '<%= test_pattern %>'
<%= test_task %>.verbose = true
end
<% end %>
<% case testing_framework %>
<% when :rspec %>
Spec::Rake::SpecTask.new(:rcov) do |spec|
spec.libs << 'lib' << 'spec'
spec.pattern = '<%= test_pattern %>'
spec.rcov = true
end
<% when :micronaut %>
Micronaut::RakeTask.new(:rcov) do |examples|
examples.pattern = '<%= test_pattern %>'
examples.rcov_opts = '-Ilib -I<%= test_dir %>'
examples.rcov = true
end
<% else %>
require 'rcov/rcovtask'
Rcov::RcovTask.new do |<%= test_task %>|
<%= test_task %>.libs << '<%= test_dir %>'
<%= test_task %>.pattern = '<%= test_pattern %>'
<%= test_task %>.verbose = true
end
<% end %>
<% if should_use_cucumber %>
require 'cucumber/rake/task'
Cucumber::Rake::Task.new(:features)
<% end %>
<% if should_use_reek %>
require 'reek/adapters/rake_task'
Reek::RakeTask.new do |t|
t.fail_on_error = true
t.verbose = false
t.source_files = 'lib/**/*.rb'
end
<% end %>
<% if should_use_roodi %>
require 'roodi'
require 'roodi_task'
RoodiTask.new do |t|
t.verbose = false
end
<% end %>
task :default => :<%= default_task %>
<% case documentation_framework %>
<% when :rdoc %>
require 'rake/rdoctask'
Rake::RDocTask.new do |rdoc|
version = File.exist?('VERSION') ? File.read('VERSION') : ""
rdoc.rdoc_dir = 'rdoc'
rdoc.title = "<%= project_name %> #{version}"
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('lib/**/*.rb')
end
<% when :yard %>
require 'yard'
YARD::Rake::YardocTask.new
<% end %>