forked from turboladen/tailor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
63 lines (50 loc) · 1.7 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
require 'bundler/gem_tasks'
require 'cucumber'
require 'cucumber/rake/task'
require 'rspec/core/rake_task'
require 'yard'
require_relative 'lib/tailor/rake_task'
Tailor::RakeTask.new do |task|
task.formatters = %w[yaml]
task.tailor_opts = %w[--output-file=output.yml]
end
#------------------------------------------------------------------------------
# spec
#------------------------------------------------------------------------------
RSpec::Core::RakeTask.new
namespace :spec do
desc "Run specs with Ruby warnings turned on"
RSpec::Core::RakeTask.new(:warn) do |t|
t.ruby_opts = %w(-w)
end
desc "Run unit tests"
RSpec::Core::RakeTask.new(:unit) do |t|
t.pattern = "./spec/unit/**/*_spec.rb"
end
desc "Run functional tests"
RSpec::Core::RakeTask.new(:functional) do |t|
t.pattern = "./spec/functional/**/*_spec.rb"
end
end
#------------------------------------------------------------------------------
# features
#------------------------------------------------------------------------------
Cucumber::Rake::Task.new(:features) do |t|
t.cucumber_opts = %w(--format progress features --tags ~@wip)
end
#------------------------------------------------------------------------------
# yard
#------------------------------------------------------------------------------
YARD::Rake::YardocTask.new do |t|
t.files = %w(lib/**/*.rb - History.rdoc)
t.options = %w(--private --protected --verbose)
end
namespace :yard do
YARD::Rake::YardocTask.new(:with_features) do |t|
YARD::Config.load_plugin 'cucumber'
t.files = %w(lib/**/*.rb features/**/*.feature - History.rdoc)
end
end
desc "Run RSpec examples and Cucumber features"
task test: [:spec, :features]
task default: [:test]