Files
ubicloud/spec/lib/thread_printer_spec.rb
Jeremy Evans 4a41370c24 Remove all skip_if_frozen{_models} calls in the specs
There is no need for these calls now that all specs are run when
frozen.
2024-10-30 12:08:24 -07:00

21 lines
707 B
Ruby

# frozen_string_literal: true
RSpec.describe ThreadPrinter do
describe "#print" do
it "can dump threads" do
expect(described_class).to receive(:puts).with(/Thread: #<Thread:.*>/)
expect(described_class).to receive(:puts).with(/backtrace/)
described_class.run
end
it "can handle threads with a nil backtrace" do
# The documentation calls out that the backtrace is an array or
# nil.
expect(described_class).to receive(:puts).with(/Thread: #<InstanceDouble.*>/)
expect(described_class).to receive(:puts).with(nil)
expect(Thread).to receive(:list).and_return([instance_double(Thread, backtrace: nil)])
described_class.run
end
end
end