Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ruby 3.1: Add specs for Thread::Backtrace.limit #957

Merged
merged 1 commit into from
Oct 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions core/thread/backtrace/limit_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
require_relative '../../../spec_helper'

ruby_version_is "3.1" do
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
end