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:
parent
0e2befa4fc
commit
4aacbf7b8f
1 changed files with 7 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue