diff options
author | Radosław Bułat <radek.bulat@gmail.com> | 2020-12-18 19:14:23 +0100 |
---|---|---|
committer | Yusuke Endoh <mame@ruby-lang.org> | 2020-12-19 12:23:58 +0900 |
commit | 51bcd50915941d21df806e8dcde769ae63b6eaaf (patch) | |
tree | 325554687a1a94ebcbb4dbcf34a03191c70deb8c /spec/ruby/core/module | |
parent | 34f6b22df073fe86e30aca99be5aa0b0eb8653df (diff) | |
download | ruby-51bcd50915941d21df806e8dcde769ae63b6eaaf.tar.gz |
Feature 17314: alias_method returns symbol
Diffstat (limited to 'spec/ruby/core/module')
-rw-r--r-- | spec/ruby/core/module/alias_method_spec.rb | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/spec/ruby/core/module/alias_method_spec.rb b/spec/ruby/core/module/alias_method_spec.rb index 742e289a3f..5d3d0c23d9 100644 --- a/spec/ruby/core/module/alias_method_spec.rb +++ b/spec/ruby/core/module/alias_method_spec.rb @@ -85,8 +85,19 @@ describe "Module#alias_method" do Module.should have_public_instance_method(:alias_method, false) end - it "returns self" do - @class.send(:alias_method, :checking_return_value, :public_one).should equal(@class) + describe "returned value" do + ruby_version_is ""..."3.0" do + it "returns self" do + @class.send(:alias_method, :checking_return_value, :public_one).should equal(@class) + end + end + + ruby_version_is "3.0" do + it "returns symbol of the defined method name" do + @class.send(:alias_method, :checking_return_value, :public_one).should equal(:checking_return_value) + @class.send(:alias_method, 'checking_return_value', :public_one).should equal(:checking_return_value) + end + end end it "works in module" do |