Permalink
Browse files

added test for fixed const leaking bug

  • Loading branch information...
1 parent 82af5c9 commit e3becbfbf6a832162fb9291459e6fdb6414f3a79 @banister banister committed Apr 30, 2011
Showing with 14 additions and 0 deletions.
  1. +14 −0 test/test.rb
View
@@ -17,6 +17,20 @@ class Hello
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)

0 comments on commit e3becbf

Please sign in to comment.