diff options
author | SHIBATA Hiroshi <hsbt@ruby-lang.org> | 2017-03-03 12:53:22 +0900 |
---|---|---|
committer | SHIBATA Hiroshi <hsbt@ruby-lang.org> | 2017-03-03 12:53:22 +0900 |
commit | 25a7b47d2a2e36ecb80beb797a9056fb1313ae40 (patch) | |
tree | d48658ea252787eb4c59bc67b5da727cd43f00df /test | |
parent | e6a533eed532bbf9bf3fc01cf5fef216dd9114b6 (diff) | |
download | psych-25a7b47d2a2e36ecb80beb797a9056fb1313ae40.zip |
use assert_nil when nil assertion
Diffstat (limited to 'test')
-rw-r--r-- | test/psych/test_scalar_scanner.rb | 6 | ||||
-rw-r--r-- | test/psych/visitors/test_yaml_tree.rb | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/test/psych/test_scalar_scanner.rb b/test/psych/test_scalar_scanner.rb index 2599989..9b6d8c1 100644 --- a/test/psych/test_scalar_scanner.rb +++ b/test/psych/test_scalar_scanner.rb @@ -79,9 +79,9 @@ module Psych end def test_scan_null - assert_equal nil, ss.tokenize('null') - assert_equal nil, ss.tokenize('~') - assert_equal nil, ss.tokenize('') + assert_nil ss.tokenize('null') + assert_nil ss.tokenize('~') + assert_nil ss.tokenize('') end def test_scan_symbol diff --git a/test/psych/visitors/test_yaml_tree.rb b/test/psych/visitors/test_yaml_tree.rb index 5755f58..ea38f6d 100644 --- a/test/psych/visitors/test_yaml_tree.rb +++ b/test/psych/visitors/test_yaml_tree.rb @@ -165,10 +165,10 @@ module Psych # http://yaml.org/type/null.html def test_nil assert_cycle nil - assert_equal nil, Psych.load('null') - assert_equal nil, Psych.load('Null') - assert_equal nil, Psych.load('NULL') - assert_equal nil, Psych.load('~') + assert_nil Psych.load('null') + assert_nil Psych.load('Null') + assert_nil Psych.load('NULL') + assert_nil Psych.load('~') assert_equal({'foo' => nil}, Psych.load('foo: ')) assert_cycle 'null' |