summaryrefslogtreecommitdiff
path: root/spec/commands/disable_pry_spec.rb
blob: db90a5ccbdd365f20b35819ff206fd33d44ba005 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

describe "disable-pry" do
  before do
    @t = pry_tester
  end

  after do
    ENV.delete 'DISABLE_PRY'
  end

  it 'should quit the current session' do
    expect { @t.process_command 'disable-pry' }.to throw_symbol :breakout
  end

  it "should set DISABLE_PRY" do
    expect(ENV['DISABLE_PRY']).to eq nil
    expect { @t.process_command 'disable-pry' }.to throw_symbol :breakout
    expect(ENV['DISABLE_PRY']).to eq 'true'
  end
end