summaryrefslogtreecommitdiff
path: root/spec/ruby/core/thread/backtrace/limit_spec.rb
blob: b55ca67ea076dfeaf11721aa7bcb98e8803e568b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
require_relative '../../../spec_helper'

describe "Thread::Backtrace.limit" do
  it "returns maximum backtrace length set by --backtrace-limit command-line option" do
    out = ruby_exe("print Thread::Backtrace.limit", options: "--backtrace-limit=2")
    out.should == "2"
  end

  it "returns -1 when --backtrace-limit command-line option is not set" do
    out = ruby_exe("print Thread::Backtrace.limit")
    out.should == "-1"
  end
end