diff options
author | francis <francis> | 2008-01-23 01:54:49 +0000 |
---|---|---|
committer | francis <francis> | 2008-01-23 01:54:49 +0000 |
commit | fdaa98e06ba6d6f8b62480a83e9ecffdbcb21402 (patch) | |
tree | 40b8b0d7602a7a17bead44e0fd3a2ea101b18bd6 /vendor/plugins/rspec/lib/spec/rake | |
parent | 60eaae4f7df1f1dae91defb87d3707451c359cf4 (diff) |
Upgrade to rspec 1.1.2
Diffstat (limited to 'vendor/plugins/rspec/lib/spec/rake')
-rw-r--r-- | vendor/plugins/rspec/lib/spec/rake/spectask.rb | 20 | ||||
-rw-r--r-- | vendor/plugins/rspec/lib/spec/rake/verify_rcov.rb | 2 |
2 files changed, 20 insertions, 2 deletions
diff --git a/vendor/plugins/rspec/lib/spec/rake/spectask.rb b/vendor/plugins/rspec/lib/spec/rake/spectask.rb index f8c6809a9..c59e226f5 100644 --- a/vendor/plugins/rspec/lib/spec/rake/spectask.rb +++ b/vendor/plugins/rspec/lib/spec/rake/spectask.rb @@ -8,7 +8,7 @@ require 'rake/tasklib' module Spec module Rake - # A Rake task that runs a set of RSpec contexts. + # A Rake task that runs a set of specs. # # Example: # @@ -44,6 +44,17 @@ module Spec # Each attribute of this task may be a proc. This allows for lazy evaluation, # which is sometimes handy if you want to defer the evaluation of an attribute value # until the task is run (as opposed to when it is defined). + # + # This task can also be used to run existing Test::Unit tests and get RSpec + # output, for example like this: + # + # require 'rubygems' + # require 'spec/rake/spectask' + # Spec::Rake::SpecTask.new do |t| + # t.ruby_opts = ['-rtest/unit'] + # t.spec_files = FileList['test/**/*_test.rb'] + # end + # class SpecTask < ::Rake::TaskLib class << self def attr_accessor(*names) @@ -106,6 +117,10 @@ module Spec # used, then the list of spec files is the union of the two. # Setting the SPEC environment variable overrides this. attr_accessor :spec_files + + # Use verbose output. If this is set to true, the task will print + # the executed spec command to stdout. Defaults to false. + attr_accessor :verbose # Defines a new task, using the name +name+. def initialize(name=:spec) @@ -161,6 +176,9 @@ module Spec cmd << %Q| > "#{out}"| STDERR.puts "The Spec::Rake::SpecTask#out attribute is DEPRECATED and will be removed in a future version. Use --format FORMAT:WHERE instead." end + if verbose + puts cmd + end unless system(cmd) STDERR.puts failure_message if failure_message raise("Command #{cmd} failed") if fail_on_error diff --git a/vendor/plugins/rspec/lib/spec/rake/verify_rcov.rb b/vendor/plugins/rspec/lib/spec/rake/verify_rcov.rb index 9715744e9..3328f9e9a 100644 --- a/vendor/plugins/rspec/lib/spec/rake/verify_rcov.rb +++ b/vendor/plugins/rspec/lib/spec/rake/verify_rcov.rb @@ -38,7 +38,7 @@ module RCov total_coverage = nil File.open(index_html).each_line do |line| - if line =~ /<tt.*>(\d+\.\d+)%<\/tt> <\/td>/ + if line =~ /<tt class='coverage_total'>(\d+\.\d+)%<\/tt>/ total_coverage = eval($1) break end |