2 require 'rspec/core/rake_task'
4 CLOBBER.include('coverage', 'specdoc')
7 RSpec::Core::RakeTask.new(:all) do |t|
8 t.pattern = FileList['spec/**/*_spec.rb']
9 t.rspec_opts = ['--color', '--format', 'documentation']
13 desc 'Generate HTML Specdocs for all specs.'
14 RSpec::Core::RakeTask.new(:specdoc) do |t|
15 specdoc_path = File.expand_path('../../specdoc', __FILE__)
17 t.rspec_opts = %W( --format html --out #{File.join(specdoc_path, 'index.html')} )
18 t.fail_on_error = false
21 RSpec::Core::RakeTask.new(:rcov) do |t|
23 if `which rcov`.strip == ""
25 "Please install rcov and ensure that its binary is in the PATH:"
27 STDERR.puts("sudo gem install rcov")
37 --exclude lib/google/api_client/environment.rb
43 desc 'Browse the code coverage report.'
44 task :browse => 'spec:rcov' do
46 Launchy::Browser.run('coverage/index.html')
52 desc 'Alias to spec:rcov'
53 task 'spec' => 'spec:rcov'
55 desc 'Alias to spec:all'
56 task 'spec' => 'spec:all'