1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00
pry--pry/spec/run_command_spec.rb
John Mair de12f255d3 Fix failing specs on ree/ruby18
We put a conditional around tests so that we skip those those using
show-source (namely the one in run_command_spec.rb) on ree/ruby18
2013-01-18 01:03:01 +01:00

25 lines
678 B
Ruby

require 'helper'
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
if !PryTestHelpers.mri18_and_no_real_source_location?
# 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/
end
end
end