File: Rakefile

package info (click to toggle)
tdiary-contrib 5.0.11-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,660 kB
  • sloc: ruby: 17,024; lisp: 546; xml: 451; php: 61; sql: 40; makefile: 18
file content (41 lines) | stat: -rw-r--r-- 826 bytes parent folder | download | duplicates (3)
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
require 'rubygems'
require 'rake'
require 'rake/clean'
require 'rspec/core/rake_task'
require 'bundler/gem_tasks'

CLOBBER.include(
	"coverage"
)

task :default => [:spec]

desc 'Run the code in specs'
RSpec::Core::RakeTask.new(:spec) do |t|
	t.pattern = "spec/**/*_spec.rb"
end

namespace :spec do
	if defined?(RCov)
		desc 'Run the code in specs with RCov'
		RSpec::Core::RakeTask.new(:report) do |t|
			t.pattern = "spec/**/*_spec.rb"
			t.rcov = true
			t.rcov_opts = IO.readlines(File.join('spec', 'rcov.opts')).map {|line| line.chomp.split(" ") }.flatten
		end
	else
		desc 'Run the code in specs with SimpleCov'
		task :report do
			ENV['COVERAGE'] = 'simplecov'
			Rake::Task["spec"].invoke
		end
	end
end

# Local Variables:
# mode: ruby
# indent-tabs-mode: t
# tab-width: 3
# ruby-indent-level: 3
# End:
# vim: ts=3