1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

More tests for [Feature #16150]

This commit is contained in:
Nobuyoshi Nakada 2019-09-27 14:01:37 +09:00
parent eff15a269f
commit 4d3502d57f
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60

View file

@ -132,6 +132,27 @@ class TestObject < Test::Unit::TestCase
assert_equal(0.0, nil.to_f)
end
def test_nil_to_s
str = nil.to_s
assert_equal("", str)
assert_predicate(str, :frozen?)
assert_same(str, nil.to_s)
end
def test_true_to_s
str = true.to_s
assert_equal("true", str)
assert_predicate(str, :frozen?)
assert_same(str, true.to_s)
end
def test_false_to_s
str = false.to_s
assert_equal("false", str)
assert_predicate(str, :frozen?)
assert_same(str, false.to_s)
end
def test_not
assert_equal(false, Object.new.send(:!))
assert_equal(true, nil.send(:!))