/
Rakefile
54 lines (47 loc) · 1.05 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
begin
require 'bundler/gem_tasks'
rescue LoadError
end
require 'cucumber'
require 'cucumber/rake/task'
require 'rspec/core/rake_task'
begin
require 'yard'
rescue LoadError
else
namespace :build do
YARD::Rake::YardocTask.new :doc
end
end
Cucumber::Rake::Task.new :features, 'Test features' do |t|
t.bundler = false
end
def define_spec_task(name, options={})
RSpec::Core::RakeTask.new name do |t|
t.rspec_opts ||= []
unless options[:debug] == false
begin
require 'ruby-debug'
rescue LoadError
else
t.rspec_opts << '--debug'
end
end
t.pattern = %w(spec/*_spec.rb spec/**/*_spec.rb)
end
end
desc 'Run specs'
define_spec_task :spec
desc 'Run specs and test features'
task '' => [:spec, :features]
task :default => [:spec, :features]
# Support the 'gem test' command.
namespace :test do
desc ''
define_spec_task :specs, :debug => false
Cucumber::Rake::Task.new :features, '' do |t|
t.bundler = false
t.cucumber_opts = '--backtrace'
end
end
task :test => %w(test:specs test:features)