ruby-changes:49051
From: k0kubun <ko1@a...>
Date: Tue, 12 Dec 2017 22:47:52 +0900 (JST)
Subject: [ruby-changes:49051] k0kubun:r61166 (trunk): test_struct.rb: rename constants to clarify
k0kubun 2017-12-12 22:47:46 +0900 (Tue, 12 Dec 2017) New Revision: 61166 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61166 Log: test_struct.rb: rename constants to clarify the intention. Follows up r61137. They were forgotten to be renamed when :keyword_args is renamed to :keyword_init. Modified files: trunk/test/ruby/test_struct.rb Index: test/ruby/test_struct.rb =================================================================== --- test/ruby/test_struct.rb (revision 61165) +++ test/ruby/test_struct.rb (revision 61166) @@ -93,19 +93,19 @@ module TestStruct https://github.com/ruby/ruby/blob/trunk/test/ruby/test_struct.rb#L93 end def test_struct_new_with_keyword_init - @Struct.new("KeywordArgsTrue", :a, :b, keyword_init: true) - @Struct.new("KeywordArgsFalse", :a, :b, keyword_init: false) + @Struct.new("KeywordInitTrue", :a, :b, keyword_init: true) + @Struct.new("KeywordInitFalse", :a, :b, keyword_init: false) - assert_raise(ArgumentError) { @Struct::KeywordArgsTrue.new(1, 2) } - assert_nothing_raised { @Struct::KeywordArgsFalse.new(1, 2) } - assert_nothing_raised { @Struct::KeywordArgsTrue.new(a: 1, b: 2) } - assert_raise(ArgumentError) { @Struct::KeywordArgsTrue.new(1, b: 2) } - assert_raise(ArgumentError) { @Struct::KeywordArgsTrue.new(a: 1, b: 2, c: 3) } - assert_equal @Struct::KeywordArgsTrue.new(a: 1, b: 2).values, @Struct::KeywordArgsFalse.new(1, 2).values + assert_raise(ArgumentError) { @Struct::KeywordInitTrue.new(1, 2) } + assert_nothing_raised { @Struct::KeywordInitFalse.new(1, 2) } + assert_nothing_raised { @Struct::KeywordInitTrue.new(a: 1, b: 2) } + assert_raise(ArgumentError) { @Struct::KeywordInitTrue.new(1, b: 2) } + assert_raise(ArgumentError) { @Struct::KeywordInitTrue.new(a: 1, b: 2, c: 3) } + assert_equal @Struct::KeywordInitTrue.new(a: 1, b: 2).values, @Struct::KeywordInitFalse.new(1, 2).values @Struct.instance_eval do - remove_const(:KeywordArgsTrue) - remove_const(:KeywordArgsFalse) + remove_const(:KeywordInitTrue) + remove_const(:KeywordInitFalse) end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/