diff options
author | Benoit Daloze <eregontp@gmail.com> | 2023-06-26 15:55:11 +0200 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2023-06-26 15:55:11 +0200 |
commit | 515bd4214497b3af02f6eef51b496ad9a0cf6b3b (patch) | |
tree | 4554360d275a3bb9dc696f952b8f3d1bcd88f18a /spec/ruby/language/variables_spec.rb | |
parent | f73fa299279ac322bd921691d1ba0e8bf2b39b5f (diff) |
Update to ruby/spec@30e1c35
Diffstat (limited to 'spec/ruby/language/variables_spec.rb')
-rw-r--r-- | spec/ruby/language/variables_spec.rb | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/spec/ruby/language/variables_spec.rb b/spec/ruby/language/variables_spec.rb index cd862727ac..23c2cdb557 100644 --- a/spec/ruby/language/variables_spec.rb +++ b/spec/ruby/language/variables_spec.rb @@ -904,22 +904,11 @@ end describe "Instance variables" do context "when instance variable is uninitialized" do - ruby_version_is ""..."3.0" do - it "warns about accessing uninitialized instance variable" do - obj = Object.new - def obj.foobar; a = @a; end - - -> { obj.foobar }.should complain(/warning: instance variable @a not initialized/, verbose: true) - end - end - - ruby_version_is "3.0" do - it "doesn't warn about accessing uninitialized instance variable" do - obj = Object.new - def obj.foobar; a = @a; end + it "doesn't warn about accessing uninitialized instance variable" do + obj = Object.new + def obj.foobar; a = @a; end - -> { obj.foobar }.should_not complain(verbose: true) - end + -> { obj.foobar }.should_not complain(verbose: true) end it "doesn't warn at lazy initialization" do |