mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
added test for fixed const leaking bug
This commit is contained in:
parent
82af5c9167
commit
e3becbfbf6
1 changed files with 14 additions and 0 deletions
14
test/test.rb
14
test/test.rb
|
@ -17,6 +17,20 @@ describe Pry do
|
|||
Object.send(:remove_const, :Hello)
|
||||
end
|
||||
|
||||
# bug fix for https://github.com/banister/pry/issues/93
|
||||
it 'should not leak pry constants into Object namespace' do
|
||||
input_string = "VERSION == ::Pry::VERSION"
|
||||
str_output = StringIO.new
|
||||
o = Object.new
|
||||
pry_tester = Pry.new(:input => StringIO.new(input_string),
|
||||
:output => str_output,
|
||||
:exception_handler => proc { |_, exception| @excep = exception },
|
||||
:print => proc {}
|
||||
).rep(o)
|
||||
|
||||
@excep.is_a?(NameError).should == true
|
||||
end
|
||||
|
||||
it 'should set an ivar on an object' do
|
||||
input_string = "@x = 10"
|
||||
input = InputTester.new(input_string)
|
||||
|
|
Loading…
Reference in a new issue