diff options
author | Benoit Daloze <[email protected]> | 2022-04-25 14:53:54 +0200 |
---|---|---|
committer | Benoit Daloze <[email protected]> | 2022-04-25 14:53:54 +0200 |
commit | 45cf4f218728a15eb36d14a6c9912086525f5e3f (patch) | |
tree | 2aa93fadcb904c226f722dde47827098b87a9846 /spec/ruby/core/method | |
parent | 6ae81d49b52563a6720d666a6118ffa6e484f398 (diff) |
Update to ruby/spec@3affe1e
Diffstat (limited to 'spec/ruby/core/method')
-rw-r--r-- | spec/ruby/core/method/shared/to_s.rb | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/spec/ruby/core/method/shared/to_s.rb b/spec/ruby/core/method/shared/to_s.rb index 0dcae41b59..6fdeaaf99c 100644 --- a/spec/ruby/core/method/shared/to_s.rb +++ b/spec/ruby/core/method/shared/to_s.rb @@ -24,19 +24,17 @@ describe :method_to_s, shared: true do @string.should =~ /\#bar/ end - ruby_version_is "2.7" do - it "returns a String containing method arguments" do - obj = MethodSpecs::Methods.new - obj.method(:zero).send(@method).should.include?("()") - obj.method(:one_req).send(@method).should.include?("(a)") - obj.method(:one_req_named).send(@method).should.include?("(a:)") - obj.method(:zero_with_block).send(@method).should.include?("(&blk)") - obj.method(:one_opt).send(@method).should.include?("(a=...)") - obj.method(:one_opt_named).send(@method).should.include?("(a: ...)") - obj.method(:zero_with_splat).send(@method).should.include?("(*a)") - obj.method(:zero_with_double_splat).send(@method).should.include?("(**a)") - obj.method(:one_req_one_opt_with_splat_and_block).send(@method).should.include?("(a, b=..., *c, &blk)") - end + it "returns a String containing method arguments" do + obj = MethodSpecs::Methods.new + obj.method(:zero).send(@method).should.include?("()") + obj.method(:one_req).send(@method).should.include?("(a)") + obj.method(:one_req_named).send(@method).should.include?("(a:)") + obj.method(:zero_with_block).send(@method).should.include?("(&blk)") + obj.method(:one_opt).send(@method).should.include?("(a=...)") + obj.method(:one_opt_named).send(@method).should.include?("(a: ...)") + obj.method(:zero_with_splat).send(@method).should.include?("(*a)") + obj.method(:zero_with_double_splat).send(@method).should.include?("(**a)") + obj.method(:one_req_one_opt_with_splat_and_block).send(@method).should.include?("(a, b=..., *c, &blk)") end it "returns a String containing the Module the method is defined in" do @@ -79,11 +77,9 @@ describe :method_to_s, shared: true do @string.should.start_with? "#<Method: #<MethodSpecs::MySub:0xXXXXXX>.bar" end - ruby_version_is '2.7' do - ruby_bug '#17428', '2.7'...'3.0' do - it "shows the metaclass and the owner for a Module instance method retrieved from a class" do - String.method(:include).inspect.should.start_with?("#<Method: #<Class:String>(Module)#include") - end + ruby_bug '#17428', ''...'3.0' do + it "shows the metaclass and the owner for a Module instance method retrieved from a class" do + String.method(:include).inspect.should.start_with?("#<Method: #<Class:String>(Module)#include") end end end |