diff options
author | nagachika <nagachika@ruby-lang.org> | 2020-09-05 19:18:07 +0900 |
---|---|---|
committer | nagachika <nagachika@ruby-lang.org> | 2020-09-05 19:18:07 +0900 |
commit | 2c9dd060ab487a96e391793bd782cef6fd471b83 (patch) | |
tree | 478740c545cc1a1bc6ff02600e1b18d79016993f /spec/ruby | |
parent | e9e4f8430a62f56a4e62dd728f4498ee4c300c12 (diff) |
Revert "Don't display singleton class in Method#inspect unless method defined there"
[Backport #16771]
This reverts commit 0d24fb774d84d4a99454ce10fd343da00049a588.
Diffstat (limited to 'spec/ruby')
-rw-r--r-- | spec/ruby/core/method/shared/to_s.rb | 18 |
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 |