aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authornagachika <nagachika@ruby-lang.org>2020-09-05 19:18:07 +0900
committernagachika <nagachika@ruby-lang.org>2020-09-05 19:18:07 +0900
commit2c9dd060ab487a96e391793bd782cef6fd471b83 (patch)
tree478740c545cc1a1bc6ff02600e1b18d79016993f /spec
parente9e4f8430a62f56a4e62dd728f4498ee4c300c12 (diff)
downloadruby-2c9dd060ab487a96e391793bd782cef6fd471b83.tar.gz
Revert "Don't display singleton class in Method#inspect unless method defined there"
[Backport #16771] This reverts commit 0d24fb774d84d4a99454ce10fd343da00049a588.
Diffstat (limited to 'spec')
-rw-r--r--spec/ruby/core/method/shared/to_s.rb18
1 files changed, 0 insertions, 18 deletions
diff --git a/spec/ruby/core/method/shared/to_s.rb b/spec/ruby/core/method/shared/to_s.rb
index 7666322936..373398a785 100644
--- a/spec/ruby/core/method/shared/to_s.rb
+++ b/spec/ruby/core/method/shared/to_s.rb
@@ -31,22 +31,4 @@ describe :method_to_s, shared: true do
it "returns a String containing the Module the method is referenced from" do
@string.should =~ /MethodSpecs::MySub/
end
-
- ruby_version_is '2.8' do
- it "returns a String containing the Module containing the method if object has a singleton class but method is not defined in the singleton class" do
- obj = MethodSpecs::MySub.new
- obj.singleton_class
- @m = obj.method(:bar)
- @string = @m.send(@method).sub(/0x\w+/, '0xXXXXXX')
- @string.should =~ /\A#<Method: MethodSpecs::MySub\(MethodSpecs::MyMod\)#bar\(\) /
- end
- end
-
- it "returns a String containing the singleton class if method is defined in the singleton class" do
- obj = MethodSpecs::MySub.new
- def obj.bar; end
- @m = obj.method(:bar)
- @string = @m.send(@method).sub(/0x\w+/, '0xXXXXXX')
- @string.should =~ /\A#<Method: #<MethodSpecs::MySub:0xXXXXXX>\.bar/
- end
end