forked from thoughtbot/shoulda-matchers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
50 lines (41 loc) · 1.39 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
require 'rubygems'
require 'bundler/setup'
require 'rake'
require 'rake/rdoctask'
require 'rake/gempackagetask'
require 'rspec/core/rake_task'
require 'cucumber/rake/task'
$LOAD_PATH.unshift("lib")
require 'shoulda/matchers/version'
Rake::RDocTask.new { |rdoc|
rdoc.rdoc_dir = 'doc'
rdoc.title = "Shoulda -- Making tests easy on the fingers and eyes"
rdoc.options << '--line-numbers'
rdoc.template = "#{ENV['template']}.rb" if ENV['template']
rdoc.rdoc_files.include('README.rdoc', 'CONTRIBUTION_GUIDELINES.rdoc', 'lib/**/*.rb')
}
RSpec::Core::RakeTask.new do |t|
t.pattern = "spec/**/*_spec.rb"
t.rspec_opts = '--color --format progress'
t.verbose = false
end
desc "Run code-coverage analysis using rcov"
RSpec::Core::RakeTask.new(:coverage) do |t|
t.rspec_opts = '--color --format progress'
t.rcov = true
t.rcov_opts = %{--exclude osx\/objc,spec,gems\/ --failure-threshold 100}
t.pattern = "spec/**/*_spec.rb"
end
eval("$specification = begin; #{IO.read('shoulda-matchers.gemspec')}; end")
Rake::GemPackageTask.new $specification do |pkg|
pkg.need_tar = true
pkg.need_zip = true
end
desc "Clean files generated by rake tasks"
task :clobber => [:clobber_rdoc, :clobber_package]
Cucumber::Rake::Task.new do |t|
t.fork = true
t.cucumber_opts = ['--format', (ENV['CUCUMBER_FORMAT'] || 'progress')]
end
desc 'Default: run specs and cucumber features'
task :default => [:spec, :cucumber]