diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-07-18 10:29:19 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-07-18 10:29:19 +0000 |
commit | 2e596f6891090eaae14aaf039b3f8d817e430e37 (patch) | |
tree | 93275f534535ed3bacd35cf81bddad8ee6f886b7 /test/ruby | |
parent | 86e266bb60e16c3a4868f6174aa8c4a5c50ff4a5 (diff) | |
download | ruby-2e596f6891090eaae14aaf039b3f8d817e430e37.tar.gz |
descriptive asssertions
* test/ruby/test_string.rb (test_uplus_minus): prefer more
descriptive asssertions than assert_equal.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_string.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb index 84fa99c2bc..2cd9cbf4c8 100644 --- a/test/ruby/test_string.rb +++ b/test/ruby/test_string.rb @@ -2735,20 +2735,20 @@ CODE 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('') |