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

added regression test for weird string interpolation bug

This commit is contained in:
John Mair 2011-06-20 20:28:38 +12:00
parent 1fad5ec28e
commit 0b184fec79

View file

@ -487,6 +487,15 @@ describe Pry do
$test_interpolation = nil $test_interpolation = nil
end end
# bug fix for https://github.com/banister/pry/issues/170
it 'should not choke on complex string interpolation when checking if ruby code is a command' do
redirect_pry_io(InputTester.new('/#{Regexp.escape(File.expand_path("."))}/'), str_output = StringIO.new) do
pry
end
str_output.string.should.not =~ /SyntaxError/
end
it 'should NOT interpolate ruby code into commands if :interpolate => false' do it 'should NOT interpolate ruby code into commands if :interpolate => false' do
klass = Pry::CommandSet.new do klass = Pry::CommandSet.new do
command "hello", "", :keep_retval => true, :interpolate => false do |arg| command "hello", "", :keep_retval => true, :interpolate => false do |arg|