2013-01-17 17:41:21 +01:00
|
|
|
describe "Pry.run_command" do
|
|
|
|
before do
|
|
|
|
o = Object.new
|
|
|
|
def o.drum
|
|
|
|
"roken is dodelijk"
|
|
|
|
end
|
|
|
|
@context = Pry.binding_for(o)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'performs a simple ls' do
|
|
|
|
@context.eval("hokey_pokey = 10")
|
2018-10-13 03:09:29 +08:00
|
|
|
Pry.run_command "ls", context: @context, output: out = StringIO.new
|
2015-03-10 22:49:29 +02:00
|
|
|
expect(out.string).to match(/hokey_pokey/)
|
2013-01-17 17:41:21 +01:00
|
|
|
end
|
|
|
|
|
2013-10-23 22:58:26 -07:00
|
|
|
# This is a regression test as 0.9.11 broke this behaviour
|
|
|
|
it 'can perform a show-source' do
|
2018-10-13 03:09:29 +08:00
|
|
|
Pry.run_command "show-source drum", context: @context, output: out = StringIO.new
|
2015-03-10 22:49:29 +02:00
|
|
|
expect(out.string).to match(/roken is dodelijk/)
|
2013-01-17 17:41:21 +01:00
|
|
|
end
|
|
|
|
end
|