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:
parent
eff15a269f
commit
4d3502d57f
1 changed files with 21 additions and 0 deletions
|
@ -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(:!))
|
||||
|
|
Loading…
Reference in a new issue