Improve Symbol Tests

This commit is contained in:
Daniel Bovensiepen
2013-06-14 22:19:02 +08:00
parent 7df35e930a
commit 7177fdbd39
+7 -6
View File
@@ -2,25 +2,26 @@
# Symbol ISO Test
assert('Symbol', '15.2.11') do
Symbol.class == Class
assert_equal Symbol.class, Class
end
assert('Symbol superclass', '15.2.11.2') do
Symbol.superclass == Object
assert_equal Symbol.superclass, Object
end
assert('Symbol#===', '15.2.11.3.1') do
:abc === :abc and not :abc === :cba
assert_true :abc == :abc
assert_false :abc == :cba
end
assert('Symbol#id2name', '15.2.11.3.2') do
:abc.id2name == 'abc'
assert_equal :abc.id2name, 'abc'
end
assert('Symbol#to_s', '15.2.11.3.3') do
:abc.to_s == 'abc'
assert_equal :abc.to_s, 'abc'
end
assert('Symbol#to_sym', '15.2.11.3.4') do
:abc.to_sym == :abc
assert_equal :abc.to_sym, :abc
end