Browse files

Fixed spec so it passes on ruby 1.9.2.

  • Loading branch information...
1 parent a8a3aba commit 6817f4ef65e373f0594d86be7cd7a2b2bda9217b @myronmarston myronmarston committed with dchelimsky Oct 9, 2010
Showing with 6 additions and 3 deletions.
  1. +4 −1 lib/autotest/rspec2.rb
  2. +2 −2 spec/autotest/failed_results_re_spec.rb
View
5 lib/autotest/rspec2.rb
@@ -10,7 +10,10 @@ def initialize
super
clear_mappings
setup_rspec_project_mappings
- self.failed_results_re = /^\s*\d\).*\n\s+Failure.*(\n\s+#\s(.*)?:\d+)+$/m
+
+ # Example for Ruby 1.8: http://rubular.com/r/AOXNVDrZpx
+ # Example for Ruby 1.9: http://rubular.com/r/85ag5AZ2jP
+ self.failed_results_re = /^\s*\d+\).*\n\s+Failure.*(\n\s+#\s(.*)?:\d+(?::.*)?)+$/m
self.completed_re = /\n(?:\e\[\d*m)?\d* examples?/m
end
View
4 spec/autotest/failed_results_re_spec.rb
@@ -14,7 +14,7 @@
it "matches a failure" do
re = Autotest::Rspec2.new.failed_results_re
- re =~ example_output
- $2.should == __FILE__.sub(File.expand_path('.'),'.')
+ example_output.should =~ re
+ example_output[re, 2].should == __FILE__.sub(File.expand_path('.'),'.')
end
end

0 comments on commit 6817f4e

Please sign in to comment.