aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cask/Rakefile
diff options
context:
space:
mode:
authorAnastasiaSulyagina2016-08-18 22:11:42 +0300
committerAnastasiaSulyagina2016-08-19 14:50:14 +0300
commite81f4ab7deeb40308f240be5ea00091fc8786d7a (patch)
treeb5418f9149de71c0f05f90cb2b39ab47f46e27b4 /Library/Homebrew/cask/Rakefile
parent5c7c9de669025bbe4cad9829be39c5cf3b31ad25 (diff)
downloadbrew-e81f4ab7deeb40308f240be5ea00091fc8786d7a.tar.bz2
init
Diffstat (limited to 'Library/Homebrew/cask/Rakefile')
-rw-r--r--Library/Homebrew/cask/Rakefile52
1 files changed, 52 insertions, 0 deletions
diff --git a/Library/Homebrew/cask/Rakefile b/Library/Homebrew/cask/Rakefile
new file mode 100644
index 000000000..a8373fa96
--- /dev/null
+++ b/Library/Homebrew/cask/Rakefile
@@ -0,0 +1,52 @@
+require "coveralls/rake/task"
+require "rake/testtask"
+require "rspec/core/rake_task"
+require "rubocop/rake_task"
+
+homebrew_repo = `brew --repository`.chomp
+$LOAD_PATH.unshift(File.expand_path("#{homebrew_repo}/Library/Homebrew"))
+$LOAD_PATH.unshift(File.expand_path("../lib", __FILE__))
+
+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
+end
+
+desc "Run tests for minitest and RSpec"
+task test: ["test:minitest", "test:rspec"]
+
+Coveralls::RakeTask.new
+
+RuboCop::RakeTask.new(:rubocop) do |t|
+ t.options = ["--force-exclusion"]
+end
+
+task default: [:test, :rubocop]
+
+desc "Open a REPL for debugging and experimentation"
+task :console do
+ require "pry"
+ require "pry-byebug"
+ require "hbc"
+ ARGV.clear
+ Hbc.pry
+end
+
+desc "Generate man page from Markdown source"
+task :man do
+ sh "ronn --roff --pipe --organization=Homebrew-Cask --manual=brew-cask " \
+ "doc/man_page/brew-cask.1.md > man/man1/brew-cask.1"
+end