2014-03-14 00:31:24 -04:00
|
|
|
require_relative 'helper'
|
2013-01-17 11:41:21 -05: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")
|
|
|
|
Pry.run_command "ls", :context => @context, :output => out = StringIO.new
|
|
|
|
out.string.should =~ /hokey_pokey/
|
|
|
|
end
|
|
|
|
|
2013-10-24 01:58:26 -04:00
|
|
|
# This is a regression test as 0.9.11 broke this behaviour
|
|
|
|
it 'can perform a show-source' do
|
|
|
|
Pry.run_command "show-source drum", :context => @context, :output => out = StringIO.new
|
|
|
|
out.string.should =~ /roken is dodelijk/
|
2013-01-17 11:41:21 -05:00
|
|
|
end
|
|
|
|
end
|