File: exit_program_spec.rb

package info (click to toggle)
pry 0.15.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,772 kB
  • sloc: ruby: 21,692; sh: 17; makefile: 11
file content (17 lines) | stat: -rw-r--r-- 394 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# frozen_string_literal: true

describe "exit-program" do
  it 'should raise SystemExit' do
    expect { pry_eval('exit-program') }.to raise_error SystemExit
  end

  it 'should exit the program with the provided value' do
    begin
      pry_eval 'exit-program 66'
    rescue SystemExit => e
      expect(e.status).to eq(66)
    else
      raise "Failed to raise SystemExit"
    end
  end
end