summaryrefslogtreecommitdiff
path: root/spec/ruby/core/method/shared/to_s.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/method/shared/to_s.rb')
-rw-r--r--spec/ruby/core/method/shared/to_s.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/ruby/core/method/shared/to_s.rb b/spec/ruby/core/method/shared/to_s.rb
index 1fbee870d6..8f7dd8c161 100644
--- a/spec/ruby/core/method/shared/to_s.rb
+++ b/spec/ruby/core/method/shared/to_s.rb
@@ -62,6 +62,12 @@ describe :method_to_s, shared: true do
@m = obj.method(:bar)
@string = @m.send(@method)
@string.should.start_with? "#<Method: MethodSpecs::MySub(MethodSpecs::MyMod)#bar"
+
+ c = MethodSpecs::MySub.dup
+ m = Module.new{def bar; end}
+ c.extend(m)
+ @string = c.method(:bar).send(@method)
+ @string.should.start_with? "#<Method: #<Class:#{c.inspect}>(#{m.inspect})#bar"
end
end