ruby-changes:57824
From: Nobuyoshi <ko1@a...>
Date: Fri, 20 Sep 2019 03:25:03 +0900 (JST)
Subject: [ruby-changes:57824] d583df5259 (master): Added version guard
https://git.ruby-lang.org/ruby.git/commit/?id=d583df5259 From d583df525922ca14ecfab7a39f0c617eb86bc804 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Fri, 20 Sep 2019 02:16:17 +0900 Subject: Added version guard [Feature #11297] [Feature #16123] diff --git a/spec/ruby/language/send_spec.rb b/spec/ruby/language/send_spec.rb index cce2e1a..290b866 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 https://github.com/ruby/ruby/blob/trunk/spec/ruby/language/send_spec.rb#L258 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 -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/