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:
parent
3c7a1c2eca
commit
6602601f56
1 changed files with 11 additions and 0 deletions
|
@ -40,6 +40,17 @@ describe Pry do
|
||||||
@excep.is_a?(NameError).should == true
|
@excep.is_a?(NameError).should == true
|
||||||
end
|
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
|
it 'should set an ivar on an object' do
|
||||||
input_string = "@x = 10"
|
input_string = "@x = 10"
|
||||||
input = InputTester.new(input_string)
|
input = InputTester.new(input_string)
|
||||||
|
|
Loading…
Add table
Reference in a new issue