forked from cloudfoundry/uaa
/
Rakefile
43 lines (37 loc) · 1.29 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
# Cloud Foundry 2012.02.03 Beta
# Copyright (c) [2009-2012] VMware, Inc. All Rights Reserved.
#
# This product is licensed to you under the Apache License, Version 2.0 (the "License").
# You may not use this product except in compliance with the License.
#
# This product includes a number of subcomponents with
# separate copyright notices and license terms. Your use of these
# subcomponents is subject to the terms and conditions of the
# subcomponent's license, as noted in the LICENSE file.
#
require "rspec/core/rake_task"
#require "bundler/gem_tasks" # only available in bundler >= 1.0.15
require "rdoc/task"
task :default => [:cover]
RSpec::Core::RakeTask.new("test") do |test|
test.rspec_opts = ["--format", "documentation", "--colour"]
test.pattern = "spec/**/*_spec.rb"
end
RDoc::Task.new do |rd|
rd.rdoc_files.include("lib/**/*.rb")
rd.rdoc_dir = "doc"
end
task :ci => [:pre_coverage, :rcov_reports, :test]
task :cov => [:pre_coverage, :test, :view_coverage]
task :cover => [:pre_coverage, :test]
task :coverage => [:pre_coverage, :test]
task :pre_coverage do
rm_rf "coverage"
ENV['COVERAGE'] = "exclude-spec exclude-vendor"
end
task :rcov_reports do
ENV['COVERAGE'] += " rcov"
end
task :view_coverage do
`firefox #{File.join(File.dirname(__FILE__), 'coverage', 'index.html')}`
end