aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/core/module/fixtures/refine.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/module/fixtures/refine.rb')
-rw-r--r--spec/ruby/core/module/fixtures/refine.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/spec/ruby/core/module/fixtures/refine.rb b/spec/ruby/core/module/fixtures/refine.rb
index 79e2e80197..e8215aa640 100644
--- a/spec/ruby/core/module/fixtures/refine.rb
+++ b/spec/ruby/core/module/fixtures/refine.rb
@@ -3,6 +3,10 @@ module ModuleSpecs
def foo; "foo" end
end
+ class ClassWithSuperFoo
+ def foo; [:C] end
+ end
+
module PrependedModule
def foo; "foo from prepended module"; end
end
@@ -11,7 +15,11 @@ module ModuleSpecs
def foo; "foo from included module"; end
end
- def self.build_refined_class
- Class.new(ClassWithFoo)
+ def self.build_refined_class(for_super: false)
+ if for_super
+ Class.new(ClassWithSuperFoo)
+ else
+ Class.new(ClassWithFoo)
+ end
end
end