ruby-changes:64269
From: Yusuke <ko1@a...>
Date: Fri, 18 Dec 2020 16:09:31 +0900 (JST)
Subject: [ruby-changes:64269] 0a60ba923e (master): Revert "Added tests for [Feature #17314]"
https://git.ruby-lang.org/ruby.git/commit/?id=0a60ba923e From 0a60ba923e044ec2e84ac63406ca85b7bb8fc73f Mon Sep 17 00:00:00 2001 From: Yusuke Endoh <mame@r...> Date: Fri, 18 Dec 2020 14:12:09 +0900 Subject: Revert "Added tests for [Feature #17314]" This reverts commit 34f06062174882a98ebef998c50ad8d4f7fc0f2e. diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb index e228786..037715b 100644 --- a/test/ruby/test_module.rb +++ b/test/ruby/test_module.rb @@ -840,11 +840,6 @@ class TestModule < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_module.rb#L840 assert_equal(:aClass1, o.aClass1) assert_equal(:aClass2, o.aClass2) - o = (c = Class.new(AClass)).new - c.class_eval {public [:aClass1, :aClass2]} - assert_equal(:aClass1, o.aClass1) - assert_equal(:aClass2, o.aClass2) - o = AClass.new assert_equal(:aClass, o.aClass) assert_raise(NoMethodError, /private method/) {o.aClass1} @@ -862,11 +857,6 @@ class TestModule < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_module.rb#L857 assert_raise(NoMethodError, /private method/) {o.aClass} assert_raise(NoMethodError, /private method/) {o.aClass2} - o = (c = Class.new(AClass)).new - c.class_eval {private [:aClass, :aClass2]} - assert_raise(NoMethodError, /private method/) {o.aClass} - assert_raise(NoMethodError, /private method/) {o.aClass2} - o = AClass.new assert_equal(:aClass, o.aClass) assert_raise(NoMethodError, /private method/) {o.aClass1} @@ -893,13 +883,6 @@ class TestModule < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_module.rb#L883 assert_equal(:aClass, c.new._aClass(o)) assert_equal(:aClass1, c.new._aClass1(o)) - o = (c = Class.new(aclass)).new - c.class_eval {protected [:aClass, :aClass1]} - assert_raise(NoMethodError, /protected method/) {o.aClass} - assert_raise(NoMethodError, /protected method/) {o.aClass1} - assert_equal(:aClass, c.new._aClass(o)) - assert_equal(:aClass1, c.new._aClass1(o)) - o = AClass.new assert_equal(:aClass, o.aClass) assert_raise(NoMethodError, /private method/) {o.aClass1} @@ -1232,15 +1215,6 @@ class TestModule < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_module.rb#L1215 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_alias_method @@ -1250,10 +1224,9 @@ class TestModule < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_module.rb#L1224 o = c.new assert_respond_to(o, :foo) assert_not_respond_to(o, :bar) - r = c.class_eval {alias_method :bar, :foo} + c.class_eval {alias_method :bar, :foo} assert_respond_to(o, :bar) assert_equal(:foo, o.bar) - assert_equal(:bar, r) end def test_undef -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/