Rakefile in itrigga-net_helper-0.2.0 vs Rakefile in itrigga-net_helper-0.3.0
- old
+ new
@@ -24,25 +24,30 @@
# dependencies defined in Gemfile
gem.require_paths << "lib/itrigga"
end
Jeweler::RubygemsDotOrgTasks.new
-require 'rake/testtask'
-Rake::TestTask.new(:test) do |test|
- test.libs << 'lib' << 'test'
- test.pattern = 'test/**/test_*.rb'
- test.verbose = true
-end
+require 'spec/version'
+require 'spec/rake/spectask'
+require 'spec/ruby'
-require 'rcov/rcovtask'
-Rcov::RcovTask.new do |test|
- test.libs << 'test'
- test.pattern = 'test/**/test_*.rb'
- test.verbose = true
- test.rcov_opts << '--exclude "gems/*"'
+Spec::Rake::SpecTask.new(:spec) do |spec|
+ RAILS_ENV = "test"
+ spec.spec_files = FileList['spec/**/*_spec.rb']
+ spec.spec_opts = ['--options', 'spec/spec.opts']
end
-task :default => :test
+task :default => :spec
+
+desc "Run all specs with rcov"
+Spec::Rake::SpecTask.new(:rcov) do |t|
+ t.spec_files = FileList['spec/**/*_spec.rb']
+ t.spec_opts = ['--options', 'spec/spec.opts']
+ t.rcov = true
+ t.rcov_dir = 'coverage'
+ t.rcov_opts = ['--exclude', "features,kernel,load-diff-lcs\.rb,instance_exec\.rb,lib/spec.rb,lib/spec/runner.rb,^spec/*,bin/spec,examples,/gems,/Library/Ruby,\.autotest,#{ENV['GEM_HOME']}"]
+ t.rcov_opts << '--sort coverage --text-summary --aggregate coverage.data'
+end
require 'rake/rdoctask'
Rake::RDocTask.new do |rdoc|
version = File.exist?('VERSION') ? File.read('VERSION') : ""