summaryrefslogtreecommitdiffhomepage
path: root/test/t/argumenterror.rb
blob: ac254afcd082c89780efd53644fef4245e0914fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
##
# 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

  assert_equal(ArgumentError.class, Class)
  assert_equal(e2.class, ArgumentError)
end

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