diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-09-20 02:16:17 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-09-20 02:21:25 +0900 |
commit | d583df525922ca14ecfab7a39f0c617eb86bc804 (patch) | |
tree | 3e01900d439fb5a12e60dd438b5af7f8acbde044 | |
parent | 7fbd2f7cc247ee66e877ab3c88f0274834c6b6c7 (diff) | |
download | ruby-d583df525922ca14ecfab7a39f0c617eb86bc804.tar.gz |
Added version guard
[Feature #11297] [Feature #16123]
-rw-r--r-- | spec/ruby/language/send_spec.rb | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/spec/ruby/language/send_spec.rb b/spec/ruby/language/send_spec.rb index cce2e1acb9..290b8662db 100644 --- a/spec/ruby/language/send_spec.rb +++ b/spec/ruby/language/send_spec.rb @@ -258,10 +258,18 @@ describe "Invoking a private setter method" do end describe "Invoking a private getter method" do - it "does not permit self as a receiver" do - receiver = LangSendSpecs::PrivateGetter.new - -> { receiver.call_self_foo }.should_not raise_error(NoMethodError) - -> { receiver.call_self_foo_or_equals(6) }.should raise_error(NoMethodError) + ruby_version_is ""..."2.7" do + it "does not permit self as a receiver" do + receiver = LangSendSpecs::PrivateGetter.new + -> { receiver.call_self_foo }.should raise_error(NoMethodError) + -> { receiver.call_self_foo_or_equals(6) }.should raise_error(NoMethodError) + end + end + ruby_version_is "2.7" do + it "permits self as a receiver" do + receiver = LangSendSpecs::PrivateGetter.new + -> { receiver.call_self_foo }.should_not raise_error(NoMethodError) + end end end |