Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit b7cb465f8f5e92cddba0ed279d9c1e14b32503f1 1 parent 258fc7e
jaycfields authored
Showing with 6 additions and 4 deletions.
  1. +3 −4 lib/expectations/blank_slate.rb
  2. +3 −0  test/successes_test.rb
View
7 lib/expectations/blank_slate.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
3  test/successes_test.rb
@@ -130,4 +130,7 @@ def save(arg)
process.finished = true
end
+ expect nil.to.be.nil?
+ expect Object.not.to.be.nil?
+
end
Please sign in to comment.
Something went wrong with that request. Please try again.