# Common spec-related code goes here

STACK_OVERFLOW_DEPTH = 10000

# Common spec-related code goes here

STACK_OVERFLOW_DEPTH = begin
  def calculate_stack_overflow_depth(n)
    calculate_stack_overflow_depth(n + 1)
  rescue SystemStackError
    n
  end
  calculate_stack_overflow_depth(2)
end

Determine maximum stack depth at runtime.
Determine maximum stack depth at runtime.
