2015-03-18 07:56:58 +08:00
|
|
|
require 'coveralls/rake/task'
|
2012-10-14 03:39:00 +08:00
|
|
|
require 'rake/testtask'
|
2014-06-29 08:33:03 +08:00
|
|
|
require 'rspec/core/rake_task'
|
2015-03-04 14:52:42 +08:00
|
|
|
require 'rubocop/rake_task'
|
2012-10-14 03:39:00 +08:00
|
|
|
|
2016-01-05 04:51:32 +08:00
|
|
|
$LOAD_PATH.unshift(File.expand_path('../lib', __FILE__))
|
|
|
|
|
2016-01-05 05:52:59 +08:00
|
|
|
namespace :test do
|
|
|
|
Rake::TestTask.new(:minitest) do |t|
|
|
|
|
# TODO: setting the --seed here is an ugly temporary hack, to remain only
|
|
|
|
# until test-suite glitches are fixed.
|
|
|
|
ENV['TESTOPTS'] = '--seed=14830' if ENV['TRAVIS']
|
|
|
|
t.pattern = "test/**/*_test.rb"
|
|
|
|
t.libs << 'test'
|
|
|
|
end
|
|
|
|
|
|
|
|
RSpec::Core::RakeTask.new(:rspec)
|
|
|
|
|
|
|
|
desc 'Run tests for minitest and RSpec with coverage'
|
|
|
|
task :coverage do
|
|
|
|
ENV['COVERAGE'] = '1'
|
|
|
|
Rake::Task[:test].invoke
|
|
|
|
end
|
2012-10-14 03:39:00 +08:00
|
|
|
end
|
|
|
|
|
2016-01-05 05:52:59 +08:00
|
|
|
desc 'Run tests for minitest and RSpec'
|
|
|
|
task :test => ['test:minitest', 'test:rspec']
|
|
|
|
|
|
|
|
Coveralls::RakeTask.new
|
2014-06-29 08:33:03 +08:00
|
|
|
|
2016-01-05 05:52:59 +08:00
|
|
|
RuboCop::RakeTask.new(:rubocop) do |t|
|
2015-03-04 14:52:42 +08:00
|
|
|
t.options = ['--force-exclusion']
|
|
|
|
end
|
|
|
|
|
|
|
|
task :default => [:test, :rubocop]
|
2015-01-27 20:34:16 +08:00
|
|
|
|
2016-01-05 04:51:32 +08:00
|
|
|
desc 'Open a REPL for debugging and experimentation'
|
2015-01-27 20:34:16 +08:00
|
|
|
task :console do
|
2016-01-05 04:51:32 +08:00
|
|
|
require 'pry'
|
|
|
|
require 'pry-byebug'
|
|
|
|
require 'vendor/homebrew-fork/global'
|
|
|
|
require 'hbc'
|
|
|
|
ARGV.clear
|
|
|
|
Hbc.pry
|
2015-01-27 20:34:16 +08:00
|
|
|
end
|
2016-01-05 04:52:06 +08:00
|
|
|
|
|
|
|
desc 'Generate man page from Markdown source'
|
|
|
|
task :man do
|
|
|
|
sh 'ronn --roff --pipe --organization=Homebrew-cask --manual=brew-cask ' \
|
|
|
|
'doc/src/brew-cask.1.md > man/man1/brew-cask.1'
|
|
|
|
end
|