[前][次][番号順一覧][スレッド一覧]

ruby-changes:60783

From: Takashi <ko1@a...>
Date: Wed, 15 Apr 2020 15:59:46 +0900 (JST)
Subject: [ruby-changes:60783] 1dad9fa5e1 (master): This test is not testing attr_writer

https://git.ruby-lang.org/ruby.git/commit/?id=1dad9fa5e1

From 1dad9fa5e1303ce0ba38f55ae81b87ab3857df62 Mon Sep 17 00:00:00 2001
From: Takashi Kokubun <takashikkbn@g...>
Date: Tue, 14 Apr 2020 23:59:02 -0700
Subject: This test is not testing attr_writer


diff --git a/test/ruby/test_super.rb b/test/ruby/test_super.rb
index 78c8ee5..d94f467 100644
--- a/test/ruby/test_super.rb
+++ b/test/ruby/test_super.rb
@@ -635,10 +635,10 @@ class TestSuper < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_super.rb#L635
   end
 
   def test_super_attr_reader
-    writer_class = Class.new do
+    reader_class = Class.new do
       attr_reader :test
     end
-    superwriter_class = Class.new(writer_class) do
+    superreader_class = Class.new(reader_class) do
       def initialize
         @test = 1 # index: 1
       end
@@ -647,15 +647,15 @@ class TestSuper < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_super.rb#L647
         super
       end
     end
-    inherited_class = Class.new(superwriter_class) do
+    inherited_class = Class.new(superreader_class) do
       def initialize
         @a = nil
         @test = 2 # index: 2
       end
     end
 
-    superwriter = superwriter_class.new
-    assert_equal 1, superwriter.test # set ic->index of superwriter_class#test to 1
+    superreader = superreader_class.new
+    assert_equal 1, superreader.test # set ic->index of superreader_class#test to 1
 
     inherited = inherited_class.new
     assert_equal 2, inherited.test # it may read index=1 while it should be index=2
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]