summaryrefslogtreecommitdiffhomepage
path: root/test/t/symbol.rb
blob: b28573e92d40a925a8f32d42d661be0e12b6f365 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
##
# Symbol ISO Test

assert('Symbol', '15.2.11') do
  Symbol.class == Class
end

assert('Symbol superclass', '15.2.11.2') do
  Symbol.superclass == Object
end

assert('Symbol#===', '15.2.11.3.1') do
  :abc === :abc and not :abc === :cba
end

assert('Symbol#id2name', '15.2.11.3.2') do
  :abc.id2name == 'abc'
end

assert('Symbol#to_s', '15.2.11.3.3') do
  :abc.to_s == 'abc'
end

assert('Symbol#to_sym', '15.2.11.3.4') do
  :abc.to_sym == :abc
end