summaryrefslogtreecommitdiffhomepage
path: root/test/t/argumenterror.rb
blob: 71cf38e26f594806ba00040e0e7b381df43a1cae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
##
# ArgumentError ISO Test

assert('ArgumentError', '15.2.24') do
  e2 = nil
  a = []
  begin
    # this will cause an exception due to the wrong arguments
    a[]
  rescue => e1
    e2 = e1
  end

  ArgumentError.class == Class and e2.class == ArgumentError
end

assert('ArgumentError superclass', '15.2.24.2') do
  ArgumentError.superclass == StandardError
end