Sha256: 18922f981ee3047ac798df924389ce60865786969ec4c621d6696eeead4a4718

Contents?: true

Size: 734 Bytes

Versions: 90

Compression:

Stored size: 734 Bytes

Contents

require 'helper'

describe "Pry.config.exception_whitelist" do
  before do
    @str_output = StringIO.new
  end

  it 'should rescue all exceptions NOT specified on whitelist' do
    Pry.config.exception_whitelist.include?(NameError).should == false
    lambda { Pry.start(self, :input => StringIO.new("raise NameError\nexit"), :output => @str_output) }.should.not.raise NameError
  end

  it 'should NOT rescue exceptions specified on whitelist' do
    old_whitelist = Pry.config.exception_whitelist
    Pry.config.exception_whitelist = [NameError]
    lambda { Pry.start(self, :input => StringIO.new("raise NameError"), :output => @str_output) }.should.raise NameError
    Pry.config.exception_whitelist = old_whitelist
  end
end


Version data entries

90 entries across 90 versions & 5 rubygems

Version Path
asana2flowdock-1.0.0 vendor/bundle/ruby/1.9.1/gems/pry-0.9.12.6/spec/exception_whitelist_spec.rb
pry-0.9.12.6 spec/exception_whitelist_spec.rb
pry-0.9.12.6-i386-mswin32 spec/exception_whitelist_spec.rb
pry-0.9.12.6-i386-mingw32 spec/exception_whitelist_spec.rb
pry-0.9.12.6-java spec/exception_whitelist_spec.rb
pry-0.9.12.5 spec/exception_whitelist_spec.rb
pry-0.9.12.5-i386-mswin32 spec/exception_whitelist_spec.rb
pry-0.9.12.5-i386-mingw32 spec/exception_whitelist_spec.rb
pry-0.9.12.5-java spec/exception_whitelist_spec.rb
pry-0.9.12.4 spec/exception_whitelist_spec.rb
pry-0.9.12.4-i386-mswin32 spec/exception_whitelist_spec.rb
pry-0.9.12.4-i386-mingw32 spec/exception_whitelist_spec.rb
pry-0.9.12.4-java spec/exception_whitelist_spec.rb
pry-0.9.12.3 spec/exception_whitelist_spec.rb
pry-0.9.12.3-i386-mswin32 spec/exception_whitelist_spec.rb
pry-0.9.12.3-i386-mingw32 spec/exception_whitelist_spec.rb
pry-0.9.12.3-java spec/exception_whitelist_spec.rb
torquebox-console-0.3.0 vendor/bundle/jruby/1.9/gems/pry-0.9.12-java/spec/exception_whitelist_spec.rb
sshp-0.0.2 vendor/ruby/1.9.1/gems/pry-0.9.12.2/spec/exception_whitelist_spec.rb
sshp-0.0.1 vendor/ruby/1.9.1/gems/pry-0.9.12.2/spec/exception_whitelist_spec.rb