Skip to content

Commit

Permalink
The rake spec tasks were added
Browse files Browse the repository at this point in the history
  • Loading branch information
kaievns committed Sep 1, 2010
1 parent d0449cd commit 762fcaa
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
*.gem
coverage*
rdoc
34 changes: 26 additions & 8 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,34 @@
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
require 'spec/rake/spectask'

desc 'Default: run unit tests.'
task :default => :test
desc 'Default: run rspec tests.'
task :default => :spec

desc 'Test the right_rails plugin.'
Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
t.libs << 'test'
t.pattern = 'test/**/*_test.rb'
t.verbose = true
desc "Run all specs in spec directory"
Spec::Rake::SpecTask.new(:spec) do |t|
t.spec_opts = ['--options', "spec/spec.opts"]
t.spec_files = FileList['spec/**/*_spec.rb']
end

namespace :spec do
desc "Run all specs in spec directory with RCov"
Spec::Rake::SpecTask.new(:rcov) do |t|
t.spec_opts = ['--options', "spec/spec.opts"]
t.spec_files = FileList['spec/**/*_spec.rb']
t.rcov = true
t.rcov_dir = 'coverage'
t.rcov_opts = lambda do
IO.readlines("spec/rcov.opts").map {|l| l.chomp.split " "}.flatten
end
end

# desc "Print Specdoc for all specs"
# Spec::Rake::SpecTask.new(:doc) do |t|
# t.spec_opts = ["--format", "specdoc", "--dry-run"]
# t.spec_files = FileList['spec/**/*_spec.rb']
# end
end

desc 'Generate documentation for the right_rails plugin.'
Expand Down
3 changes: 3 additions & 0 deletions spec/rcov.opts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
--sort coverage
--text-summary
--aggregate coverage.data

0 comments on commit 762fcaa

Please sign in to comment.