1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00

added test to ensure pry works inside objects without direct access to toplevel constants (e.g BasicObject)

This commit is contained in:
John Mair 2011-06-11 23:37:53 +12:00
parent 3c7a1c2eca
commit 6602601f56

View file

@ -40,6 +40,17 @@ describe Pry do
@excep.is_a?(NameError).should == true
end
if defined?(BasicObject)
it 'should be able to operate inside the BasicObject class' do
$obj = nil
redirect_pry_io(InputTester.new(":foo", "$obj = _", "exit-all"), StringIO.new) do
BasicObject.pry
end
$obj.should == :foo
$obj = nil
end
end
it 'should set an ivar on an object' do
input_string = "@x = 10"
input = InputTester.new(input_string)