Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add fixtures for prepended modules

  • Loading branch information...
commit ea2fae5c63c5386b55461282962d53c4a26add19 1 parent 8fe17e5
Piotr Niełacny authored
Showing with 31 additions and 0 deletions.
  1. +31 −0 spec/ruby/core/module/fixtures/classes.rb
31 spec/ruby/core/module/fixtures/classes.rb
View
@@ -381,6 +381,37 @@ 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
+ end
+ end
+
module ModuleToPrepend
def m
result = super if defined?(super)
Please sign in to comment.
Something went wrong with that request. Please try again.