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

added tests for optional binding paramter to CommandProcessor#valid_command?

This commit is contained in:
John Mair 2011-06-09 14:41:37 +12:00
parent 0e2befa4fc
commit 4aacbf7b8f

View file

@ -19,8 +19,15 @@ describe "Pry::CommandProcessor" do
valid = @command_processor.valid_command? "blah"
valid.should == false
a = "test-command"
# not passing in a binding so 'a' shoudn't exist and should cause error
lambda { @command_processor.valid_command? '#{a}' }.should.raise NameError
# passing in the optional binding (against which interpolation is performed)
valid = @command_processor.valid_command? '#{a}', binding
valid.should == true
end
it 'should correctly match a simple string command' do