ruby-changes:47245
From: nobu <ko1@a...>
Date: Tue, 18 Jul 2017 19:29:25 +0900 (JST)
Subject: [ruby-changes:47245] nobu:r59360 (trunk): descriptive asssertions
nobu 2017-07-18 19:29:19 +0900 (Tue, 18 Jul 2017) New Revision: 59360 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=59360 Log: descriptive asssertions * test/ruby/test_string.rb (test_uplus_minus): prefer more descriptive asssertions than assert_equal. Modified files: trunk/test/ruby/test_string.rb Index: test/ruby/test_string.rb =================================================================== --- test/ruby/test_string.rb (revision 59359) +++ test/ruby/test_string.rb (revision 59360) @@ -2735,20 +2735,20 @@ CODE https://github.com/ruby/ruby/blob/trunk/test/ruby/test_string.rb#L2735 def test_uplus_minus str = "foo" - assert_equal(false, str.frozen?) - assert_equal(false, (+str).frozen?) - assert_equal(true, (-str).frozen?) + assert_not_predicate(str, :frozen?) + assert_not_predicate(+str, :frozen?) + assert_predicate(-str, :frozen?) - assert_equal(str.object_id, (+str).object_id) - assert_not_equal(str.object_id, (-str).object_id) + assert_same(str, +str) + assert_not_send(str, -str) str = "bar".freeze - assert_equal(true, str.frozen?) - assert_equal(false, (+str).frozen?) - assert_equal(true, (-str).frozen?) + assert_predicate(str, :frozen?) + assert_not_predicate(+str, :frozen?) + assert_predicate(-str, :frozen?) - assert_not_equal(str.object_id, (+str).object_id) - assert_equal(str.object_id, (-str).object_id) + assert_not_same(str, +str) + assert_same(str, -str) return unless @cls == String bar = %w(b a r).join('') -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/