From 2e2bc9b136b39ffd2eab23842417f3893da14f85 Mon Sep 17 00:00:00 2001 From: John Mair Date: Fri, 10 Jun 2011 23:19:13 +1200 Subject: [PATCH] added spec to test_command_processor.rb that ensures commands with :interpolate=>false do NOT have interpolate_string called in their processing --- test/test_command_processor.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/test_command_processor.rb b/test/test_command_processor.rb index 47226262..5a25a8fd 100644 --- a/test/test_command_processor.rb +++ b/test/test_command_processor.rb @@ -190,4 +190,14 @@ describe "Pry::CommandProcessor" do command.should == nil end + + + it 'commands that have :interpolate => false should not be interpolated (interpolate_string should *not* be called)' do + @pry.commands.command("boast", "", :interpolate => false) {} + + # remember to use '' instead of "" when testing interpolation or + # you'll cause yourself incredible confusion + lambda { @command_processor.command_matched('boast #{c}', binding) }.should.not.raise NameError + end + end