ruby-changes:64304
From: Yusuke <ko1@a...>
Date: Sat, 19 Dec 2020 03:26:50 +0900 (JST)
Subject: [ruby-changes:64304] 0e79d4cde5 (master): Added tests for [Feature #17314]
https://git.ruby-lang.org/ruby.git/commit/?id=0e79d4cde5 From 0e79d4cde547edd52b2d5bf576780906e45a742d Mon Sep 17 00:00:00 2001 From: Yusuke Endoh <mame@r...> Date: Sat, 19 Dec 2020 03:25:48 +0900 Subject: Added tests for [Feature #17314] Partially reintroduce 34f06062174882a98ebef998c50ad8d4f7fc0f2e diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb index c45b884..a0f7a6d 100644 --- a/test/ruby/test_module.rb +++ b/test/ruby/test_module.rb @@ -1154,6 +1154,15 @@ class TestModule < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_module.rb#L1154 assert_raise(NameError) do c.instance_eval { attr_reader :"." } end + + assert_equal([:a], c.class_eval { attr :a }) + assert_equal([:b, :c], c.class_eval { attr :b, :c }) + assert_equal([:d], c.class_eval { attr_reader :d }) + assert_equal([:e, :f], c.class_eval { attr_reader :e, :f }) + assert_equal([:g=], c.class_eval { attr_writer :g }) + assert_equal([:h=, :i=], c.class_eval { attr_writer :h, :i }) + assert_equal([:g, :g=], c.class_eval { attr_accessor :g }) + assert_equal([:h, :h=, :i, :i=], c.class_eval { attr_accessor :h, :i }) end def test_undef -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/