From f906a3ab0b3f1ed0f18e5b605787cfa7c084b19a Mon Sep 17 00:00:00 2001 From: francis Date: Wed, 23 Jan 2008 01:55:01 +0000 Subject: Upgrade to new rspec_on_rails (that is with rspec 1.1.2) --- vendor/plugins/rspec_on_rails/tasks/rspec.rake | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'vendor/plugins/rspec_on_rails/tasks') diff --git a/vendor/plugins/rspec_on_rails/tasks/rspec.rake b/vendor/plugins/rspec_on_rails/tasks/rspec.rake index c9536e86a..722854740 100644 --- a/vendor/plugins/rspec_on_rails/tasks/rspec.rake +++ b/vendor/plugins/rspec_on_rails/tasks/rspec.rake @@ -25,7 +25,9 @@ namespace :spec do t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""] t.spec_files = FileList['spec/**/*_spec.rb'] t.rcov = true - t.rcov_opts = ['--exclude', 'spec', '--rails'] + t.rcov_opts = lambda do + IO.readlines("#{RAILS_ROOT}/spec/rcov.opts").map {|l| l.chomp.split " "}.flatten + end end desc "Print Specdoc for all specs (excluding plugin specs)" @@ -56,7 +58,7 @@ namespace :spec do namespace :plugins do desc "Runs the examples for rspec_on_rails" - Spec::Rake::SpecTask.new(:rspec_on_rails => spec_prereq) do |t| + Spec::Rake::SpecTask.new(:rspec_on_rails) do |t| t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""] t.spec_files = FileList['vendor/plugins/rspec_on_rails/spec/**/*_spec.rb'] end @@ -72,14 +74,16 @@ namespace :spec do # Setup specs for stats task :statsetup do require 'code_statistics' - ::STATS_DIRECTORIES << %w(Model\ specs spec/models) - ::STATS_DIRECTORIES << %w(View\ specs spec/views) - ::STATS_DIRECTORIES << %w(Controller\ specs spec/controllers) - ::STATS_DIRECTORIES << %w(Helper\ specs spec/views) - ::CodeStatistics::TEST_TYPES << "Model specs" - ::CodeStatistics::TEST_TYPES << "View specs" - ::CodeStatistics::TEST_TYPES << "Controller specs" - ::CodeStatistics::TEST_TYPES << "Helper specs" + ::STATS_DIRECTORIES << %w(Model\ specs spec/models) if File.exist?('spec/models') + ::STATS_DIRECTORIES << %w(View\ specs spec/views) if File.exist?('spec/views') + ::STATS_DIRECTORIES << %w(Controller\ specs spec/controllers) if File.exist?('spec/controllers') + ::STATS_DIRECTORIES << %w(Helper\ specs spec/helpers) if File.exist?('spec/helpers') + ::STATS_DIRECTORIES << %w(Library\ specs spec/lib) if File.exist?('spec/lib') + ::CodeStatistics::TEST_TYPES << "Model specs" if File.exist?('spec/models') + ::CodeStatistics::TEST_TYPES << "View specs" if File.exist?('spec/views') + ::CodeStatistics::TEST_TYPES << "Controller specs" if File.exist?('spec/controllers') + ::CodeStatistics::TEST_TYPES << "Helper specs" if File.exist?('spec/helpers') + ::CodeStatistics::TEST_TYPES << "Library specs" if File.exist?('spec/lib') ::STATS_DIRECTORIES.delete_if {|a| a[0] =~ /test/} end -- cgit v1.2.3