rakelib/rspec.rake in vic-buildr-1.3.1 vs rakelib/rspec.rake in vic-buildr-1.3.3

- old
+ new

@@ -17,40 +17,43 @@ begin require 'spec/rake/spectask' directory 'reports' task 'clobber' do - rm 'failing' rescue nil + rm_f 'failed' rm_rf 'reports' end desc 'Run all specs' Spec::Rake::SpecTask.new('spec'=>'reports') do |task| - task.spec_files = FileList['spec/**/*_spec.rb'] - task.spec_opts << '--options' << 'spec/spec.opts' << '--format' << 'failing_examples:failing' << - '--format' << 'html:reports/specs.html' << '--backtrace' + task.spec_files = Dir['spec/**/*_spec.rb'] + task.spec_opts = %w{--format specdoc --format failing_examples:failed --format html:reports/specs.html --loadby mtime --backtrace} + task.spec_opts << '--colour' if $stdout.isatty end file 'reports/specs.html'=>'spec' - desc 'Run all failing examples from previous run' - Spec::Rake::SpecTask.new('failing') do |task| - task.spec_files = FileList['spec/**/*_spec.rb'] - task.spec_opts << '--options' << 'spec/spec.opts' << '--format' << 'failing_examples:failing' << '--example' << 'failing' + desc 'Run all failed examples from previous run' + Spec::Rake::SpecTask.new('failed') do |task| + task.spec_files = Dir['spec/**/*_spec.rb'] + task.spec_opts = %w{--format specdoc --format failing_examples:failed --example failed --backtrace} + task.spec_opts << '--colour' if $stdout.isatty end + # TODO: Horribly broken! Fix some other time. + desc 'Run RSpec and generate Spec and coverage reports (slow)' + Spec::Rake::SpecTask.new('coverage'=>'reports') do |task| + task.spec_files = Dir['spec/**/*_spec.rb'] + task.spec_opts = %W{--format progress --format failing_examples:failed --format html:reports/specs.html --backtrace} + task.spec_opts << '--colour' if $stdout.isatty + task.rcov = true + task.rcov_dir = 'reports/coverage' + task.rcov_opts << '--exclude / --include-file ^lib --text-summary' + end + file 'reports/coverage'=>'coverage' + # Useful for testing with JRuby when using Ruby and vice versa. namespace 'spec' do -=begin - # TODO: Horribly broken! Fix some other time. - desc 'Run RSpec and generate Spec and coverage reports (slow)' - Spec::Rake::SpecTask.new('rcov') do |task| - task.spec_files = FileList['spec/**/*spec.rb'] - task.rcov = true - task.rcov_opts = '--exclude', 'spec,bin' - task.rcov_dir = 'coverage' - end -=end desc 'Run all specs specifically with Ruby' task 'ruby' do puts 'Running test suite using Ruby ...' sh 'ruby -S rake spec' @@ -75,7 +78,6 @@ end end task 'stage:prepare'=>'spec' -task 'stage:prepare'=>RUBY_PLATFORM =~ /java/ ? 'spec:ruby' : 'spec:jruby' -# TODO: Add Rcov when we get it working again. +task 'stage:prepare'=>RUBY_PLATFORM =~ /java/ ? 'spec:ruby' : 'spec:jruby' # Test the *other* platform \ No newline at end of file