Permalink
Browse files

fixing infinite loop in blank slate

git-svn-id: http://expectations.rubyforge.org/svn/trunk@64 6f265639-962f-4d85-a13b-3090ac0aa348
  • Loading branch information...
1 parent 258fc7e commit b7cb465f8f5e92cddba0ed279d9c1e14b32503f1 jaycfields committed Mar 28, 2008
Showing with 6 additions and 4 deletions.
  1. +3 −4 lib/expectations/blank_slate.rb
  2. +3 −0 test/successes_test.rb
@@ -76,12 +76,11 @@ def method_added(name)
#
class Object
class << self
- alias_method :blank_slate_method_added, :method_added
-
# Detect method additions to Object and remove them in the
# BlankSlate class.
- def method_added(name)
- result = blank_slate_method_added(name)
+ unbound_method = method(:method_added)
+ define_method :method_added do |name|
+ result = unbound_method.call(name)
return result if self != Object
BlankSlate.hide(name)
result
View
@@ -130,4 +130,7 @@ def save(arg)
process.finished = true
end
+ expect nil.to.be.nil?
+ expect Object.not.to.be.nil?
+
end

0 comments on commit b7cb465

Please sign in to comment.