Skip to content

Commit

Permalink
Do not load classes with prepend in ruby < 1.9.3
Browse files Browse the repository at this point in the history
  • Loading branch information
LTe committed Aug 21, 2012
1 parent 648a7e8 commit 49e09d8
Showing 1 changed file with 40 additions and 38 deletions.
78 changes: 40 additions & 38 deletions spec/ruby/core/module/fixtures/classes.rb
Expand Up @@ -381,48 +381,50 @@ def extend_object(obj)
end
end

module PrependModules
module M0
def m1; [:M0] end
end
module M1
def m1; [:M1, *super] end
end
module M2
def m1; [:M2, *super] end
end
M3 = Module.new do
def m1; [:M3, *super] end
end
module M4
def m1; [:M4, *super] end
end
class C
def m1; end
end
class C0 < C
include M0
prepend M1
def m1; [:C0, *super] end
end
class C1 < C0
prepend M2, M3
include M4
def m1; [:C1, *super] end
if RUBY_VERSION > "1.9.3"
module PrependModules
module M0
def m1; [:M0] end
end
module M1
def m1; [:M1, *super] end
end
module M2
def m1; [:M2, *super] end
end
M3 = Module.new do
def m1; [:M3, *super] end
end
module M4
def m1; [:M4, *super] end
end
class C
def m1; end
end
class C0 < C
include M0
prepend M1
def m1; [:C0, *super] end
end
class C1 < C0
prepend M2, M3
include M4
def m1; [:C1, *super] end
end
end
end

module ModuleToPrepend
def m
result = super
[:m, result]
module ModuleToPrepend
def m
result = super
[:m, result]
end
end
end

class ClassToPrepend
prepend ModuleToPrepend
def m
:c
class ClassToPrepend
prepend ModuleToPrepend
def m
:c
end
end
end
end
Expand Down

0 comments on commit 49e09d8

Please sign in to comment.