Commit dc54e684cd413ab7b85341882667c74ff8c18a25
- Date: Sat Feb 16 06:08:17 +0000 2008
- Committer: dchelimsky (dchelimsky@410327ef-2207-0410-a325-f78bbcb22a5a)
- Author: dchelimsky (dchelimsky@410327ef-2207-0410-a325-f78bbcb22a5a)
- Commit SHA1: dc54e684cd413ab7b85341882667c74ff8c18a25
- Tree SHA1: be8c939c57e7354890c2ee8edf5ee1fe50c666bb
Got rspec/autotest compatibility closer. Seems to be working well now with everything but --drb."
git-svn-id: http://rspec.rubyforge.org/svn/trunk@3311 410327ef-2207-0410-a325-f78bbcb22a5a
Commit diff
| |   |
| 22 | 22 | def initialize |
| 23 | 23 | super |
| 24 | 24 | self.failed_results_re = /^\d+\)\n(?:\e\[\d*m)?(?:.*?Error in )?'([^\n]*)'(?: FAILED)?(?:\e\[\d*m)?\n(.*?)\n\n/m |
| 25 | | self.completed_re = /\Z/ # FIX: some sort of summary line at the end? |
| 25 | self.completed_re = /\n(?:\e\[\d*m)?\d* examples?/m |
| 26 | 26 | end |
| 27 | 27 | |
| 28 | 28 | def consolidate_failures(failed) |
| 29 | | filters = Hash.new { |h,k| h[k] = [] } |
| 30 | | failed.each do |spec, failed_trace| |
| 31 | | if f = test_files_for(failed).find { |f| failed_trace =~ Regexp.new(f) } then |
| 32 | | filters[f] << spec |
| 33 | | break |
| 29 | filters = new_hash_of_arrays |
| 30 | failed.each do |spec, trace| |
| 31 | if trace =~ /\n(\.\/)?(.*\.rb):[\d]+:\Z?/ |
| 32 | filters[$2] << spec |
| 34 | 33 | end |
| 35 | 34 | end |
| 36 | 35 | return filters |
| toggle raw diff |
--- a/rspec/lib/autotest/rspec.rb
+++ b/rspec/lib/autotest/rspec.rb
@@ -22,15 +22,14 @@ class Autotest::Rspec < Autotest
def initialize
super
self.failed_results_re = /^\d+\)\n(?:\e\[\d*m)?(?:.*?Error in )?'([^\n]*)'(?: FAILED)?(?:\e\[\d*m)?\n(.*?)\n\n/m
- self.completed_re = /\Z/ # FIX: some sort of summary line at the end?
+ self.completed_re = /\n(?:\e\[\d*m)?\d* examples?/m
end
def consolidate_failures(failed)
- filters = Hash.new { |h,k| h[k] = [] }
- failed.each do |spec, failed_trace|
- if f = test_files_for(failed).find { |f| failed_trace =~ Regexp.new(f) } then
- filters[f] << spec
- break
+ filters = new_hash_of_arrays
+ failed.each do |spec, trace|
+ if trace =~ /\n(\.\/)?(.*\.rb):[\d]+:\Z?/
+ filters[$2] << spec
end
end
return filters |
| |   |
| 6 | 6 | TINY = 3 |
| 7 | 7 | RELEASE_CANDIDATE = nil |
| 8 | 8 | |
| 9 | | BUILD_TIME_UTC = 20080215164335 |
| 9 | BUILD_TIME_UTC = 20080216032148 |
| 10 | 10 | |
| 11 | 11 | STRING = [MAJOR, MINOR, TINY].join('.') |
| 12 | 12 | TAG = "REL_#{[MAJOR, MINOR, TINY, RELEASE_CANDIDATE].compact.join('_')}".upcase.gsub(/\.|-/, '_') |
| toggle raw diff |
--- a/rspec/lib/spec/version.rb
+++ b/rspec/lib/spec/version.rb
@@ -6,7 +6,7 @@ module Spec
TINY = 3
RELEASE_CANDIDATE = nil
- BUILD_TIME_UTC = 20080215164335
+ BUILD_TIME_UTC = 20080216032148
STRING = [MAJOR, MINOR, TINY].join('.')
TAG = "REL_#{[MAJOR, MINOR, TINY, RELEASE_CANDIDATE].compact.join('_')}".upcase.gsub(/\.|-/, '_')
|
| |   |
| 171 | 171 | common_setup |
| 172 | 172 | @rspec_autotest = Rspec.new |
| 173 | 173 | |
| 174 | | @spec_file = "./spec/autotest/rspec_spec.rb" |
| 174 | @spec_file = "spec/autotest/rspec_spec.rb" |
| 175 | 175 | @rspec_autotest.instance_variable_set("@files", {@spec_file => Time.now}) |
| 176 | 176 | @rspec_autotest.stub!(:find_files_to_test).and_return true |
| 177 | 177 | end |
| … | … | |
| 181 | 181 | end |
| 182 | 182 | |
| 183 | 183 | it "should return a hash with the spec filename => spec name for each failure or error" do |
| 184 | | @rspec_autotest.stub!(:test_files_for).and_return "./spec/autotest/rspec_spec.rb" |
| 184 | @rspec_autotest.stub!(:test_files_for).and_return "spec/autotest/rspec_spec.rb" |
| 185 | 185 | failures = [ |
| 186 | 186 | [ |
| 187 | 187 | "false should be false", |
| 188 | 188 | "expected: true,\n got: false (using ==)\n#{@spec_file}:203:" |
| 189 | 189 | ] |
| 190 | 190 | ] |
| 191 | | @rspec_autotest.consolidate_failures(failures).should == {@spec_file => ["false should be false"]} |
| 191 | @rspec_autotest.consolidate_failures(failures).should == { |
| 192 | @spec_file => ["false should be false"] |
| 193 | } |
| 192 | 194 | end |
| 193 | 195 | |
| 194 | 196 | end |
| toggle raw diff |
--- a/rspec/spec/autotest/rspec_spec.rb
+++ b/rspec/spec/autotest/rspec_spec.rb
@@ -171,7 +171,7 @@ HERE
common_setup
@rspec_autotest = Rspec.new
- @spec_file = "./spec/autotest/rspec_spec.rb"
+ @spec_file = "spec/autotest/rspec_spec.rb"
@rspec_autotest.instance_variable_set("@files", {@spec_file => Time.now})
@rspec_autotest.stub!(:find_files_to_test).and_return true
end
@@ -181,14 +181,16 @@ HERE
end
it "should return a hash with the spec filename => spec name for each failure or error" do
- @rspec_autotest.stub!(:test_files_for).and_return "./spec/autotest/rspec_spec.rb"
+ @rspec_autotest.stub!(:test_files_for).and_return "spec/autotest/rspec_spec.rb"
failures = [
[
"false should be false",
"expected: true,\n got: false (using ==)\n#{@spec_file}:203:"
]
]
- @rspec_autotest.consolidate_failures(failures).should == {@spec_file => ["false should be false"]}
+ @rspec_autotest.consolidate_failures(failures).should == {
+ @spec_file => ["false should be false"]
+ }
end
end |
| |   |
| 1 | 1 | module Spec |
| 2 | 2 | module Rails |
| 3 | 3 | module VERSION #:nodoc: |
| 4 | | BUILD_TIME_UTC = 20080215164335 |
| 4 | BUILD_TIME_UTC = 20080216032148 |
| 5 | 5 | end |
| 6 | 6 | end |
| 7 | 7 | end |
| toggle raw diff |
--- a/rspec_on_rails/lib/spec/rails/version.rb
+++ b/rspec_on_rails/lib/spec/rails/version.rb
@@ -1,7 +1,7 @@
module Spec
module Rails
module VERSION #:nodoc:
- BUILD_TIME_UTC = 20080215164335
+ BUILD_TIME_UTC = 20080216032148
end
end
end
|