diff options
Diffstat (limited to 'spec/ruby/core/module/fixtures/classes.rb')
| -rw-r--r-- | spec/ruby/core/module/fixtures/classes.rb | 50 |
1 files changed, 49 insertions, 1 deletions
diff --git a/spec/ruby/core/module/fixtures/classes.rb b/spec/ruby/core/module/fixtures/classes.rb index f93c39683e..964f64c593 100644 --- a/spec/ruby/core/module/fixtures/classes.rb +++ b/spec/ruby/core/module/fixtures/classes.rb @@ -1,11 +1,14 @@ module ModuleSpecs def self.without_test_modules(modules) - ignore = %w[MSpecRSpecAdapter PP::ObjectMixin ModuleSpecs::IncludedInObject MainSpecs::Module ConstantSpecs::ModuleA] + ignore = %w[MSpecRSpecAdapter PP::ObjectMixin MainSpecs::Module ConstantSpecs::ModuleA] modules.reject { |k| ignore.include?(k.name) } end CONST = :plain_constant + class NamedClass + end + module PrivConstModule PRIVATE_CONSTANT = 1 private_constant :PRIVATE_CONSTANT @@ -39,6 +42,14 @@ module ModuleSpecs class LookupChild < Lookup end + module ModuleWithPrepend + prepend LookupMod + end + + class WithPrependedModule + include ModuleWithPrepend + end + class Parent # For private_class_method spec def self.private_method; end @@ -349,6 +360,10 @@ module ModuleSpecs end end + class SubCVars < CVars + @@sub = :sub + end + module MVars @@mvar = :mvar end @@ -373,6 +388,7 @@ module ModuleSpecs # empty modules module M1; end module M2; end + module M3; end module Autoload def self.use_ex1 @@ -386,6 +402,12 @@ module ModuleSpecs end end + class Parent + end + + class Child < Parent + end + module FromThread module A autoload :B, fixture(__FILE__, "autoload_empty.rb") @@ -574,6 +596,32 @@ module ModuleSpecs private :foo end EmptyFooMethod = m.instance_method(:foo) + + # for undefined_instance_methods spec + module UndefinedInstanceMethods + module Super + def super_included_method; end + end + + class Parent + def undefed_method; end + undef_method :undefed_method + + def parent_method; end + def another_parent_method; end + end + + class Child < Parent + include Super + + undef_method :parent_method + undef_method :another_parent_method + end + + class Grandchild < Child + undef_method :super_included_method + end + end end class Object |
