-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
66 lines (54 loc) · 1.53 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
65
66
# encoding: utf-8
require 'rubygems'
require 'bundler'
require 'churn'
begin
Bundler.setup(:default, :development)
rescue Bundler::BundlerError => e
$stderr.puts e.message
$stderr.puts "Run `bundle install` to install missing gems"
exit e.status_code
end
require 'rake'
require 'rake/testtask'
require 'cucumber'
require 'cucumber/rake/task'
require 'rubygems/tasks'
Gem::Tasks.new
Rake::TestTask.new(:test) do |test|
files = Dir['test/**/test_*.rb'].reject{ |f| f[%r{_authenticated.rb}] }
test.libs << 'lib' << 'test'
test.test_files = files
test.verbose = true
end
Rake::TestTask.new(:test_with_authentication) do |test|
files = Dir['test/**/test_*.rb'].select{ |f| f[%r{_authenticated.rb}] }
test.libs << 'lib' << 'test'
test.test_files = files
test.verbose = true
end
Cucumber::Rake::Task.new(:features) do |t|
t.cucumber_opts = "features --format pretty"
end
begin
require 'cane/rake_task'
desc "Run cane to check quality metrics"
Cane::RakeTask.new(:quality) do |cane|
cane.abc_max = 22
cane.add_threshold 'coverage/covered_percent', :>=, 40
cane.abc_glob = '{lib,test}/**/*.rb'
cane.no_doc = true
cane.style_glob = '{lib}/**/*.rb'
# cane.no_style = true
# cane.abc_exclude = %w(Foo::Bar#some_method)
end
# task :default => :quality
rescue LoadError
warn "cane not available, quality task not provided."
end
task :default => :all
task :all do |t|
Rake::Task["test"].invoke
Rake::Task["features"].invoke
Rake::Task["quality"].invoke if Rake::Task.task_defined?("quality")
end