removes Object#extended_by

This commit is contained in:
Xavier Noria 2010-01-26 23:03:58 +01:00
parent ccec730d7f
commit c25ac0deee
2 changed files with 0 additions and 11 deletions

@ -1,8 +1,4 @@
require 'active_support/core_ext/object/blank'
class Object
def extended_by #:nodoc:
ancestors = class << self; ancestors end
ancestors.select { |mod| mod.class == Module } - [ Object, Kernel ]
end
end

@ -40,13 +40,6 @@ class Foo
end
class ObjectTests < Test::Unit::TestCase
def test_extended_by
foo = Foo.new
assert foo.extended_by.include?(Bar)
foo.extend(Baz)
assert(([Bar, Baz] - foo.extended_by).empty?, "Expected Bar, Baz in #{foo.extended_by.inspect}")
end
class DuckTime
def acts_like_time?
true