Permalink
Browse files

- Fixed stack overflow caused by double include in Test::Unit adapter…

… (reported by Dave Myron)
  • Loading branch information...
1 parent 0e133e7 commit fb245c69d80669fb3e0fcf420ccf55082b74b87e Brian Takita committed Oct 19, 2009
Showing with 17 additions and 11 deletions.
  1. +1 −0 CHANGES
  2. +1 −0 README.rdoc
  3. +13 −11 lib/rr/adapters/test_unit.rb
  4. +2 −0 spec/rr/test_unit/test_unit_integration_test.rb
View
@@ -1,3 +1,4 @@
+- Fixed stack overflow caused by double include in Test::Unit adapter (reported by Dave Myron)
- Fixed warnings (Patch by Bryan Helmkamp)
0.10.4
View
@@ -326,6 +326,7 @@ to making it possible. We all are standing on the shoulders of giants.
* Christopher Redinger for patches
* Dan North for syntax ideas
* Dave Astels for some BDD inspiration
+* Dave Myron for a bug report
* David Chelimsky for encouragement to make the RR framework, for developing the Rspec mock framework, syntax ideas, and patches
* Daniel Sudol for identifing performance issues with RR
* Felix Morio for pairing with me
@@ -5,19 +5,21 @@ module TestUnit
def self.included(mod)
RR.trim_backtrace = true
mod.class_eval do
- alias_method :setup_without_rr, :setup
- def setup_with_rr
- setup_without_rr
- RR.reset
- end
- alias_method :setup, :setup_with_rr
+ unless instance_methods.include?('setup_with_rr')
+ alias_method :setup_without_rr, :setup
+ def setup_with_rr
+ setup_without_rr
+ RR.reset
+ end
+ alias_method :setup, :setup_with_rr
- alias_method :teardown_without_rr, :teardown
- def teardown_with_rr
- RR.verify
- teardown_without_rr
+ alias_method :teardown_without_rr, :teardown
+ def teardown_with_rr
+ RR.verify
+ teardown_without_rr
+ end
+ alias_method :teardown, :teardown_with_rr
end
- alias_method :teardown, :teardown_with_rr
end
end
@@ -1,6 +1,8 @@
require File.expand_path("#{File.dirname(__FILE__)}/test_helper")
class TestUnitIntegrationTest < Test::Unit::TestCase
+ include RR::Adapters::TestUnit # Testing against double inclusion issues
+
def setup
super
@subject = Object.new

0 comments on commit fb245c6

Please sign in to comment.