mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
Update specs using yield matcher
This commit is contained in:
parent
5b12626a41
commit
72b486f43b
2 changed files with 29 additions and 31 deletions
|
|
@ -48,11 +48,10 @@ describe Pry::CommandSet do
|
|||
end
|
||||
|
||||
it 'should pass arguments of the command to the block' do
|
||||
@set.command 'foo' do |*args|
|
||||
args.should == [1, 2, 3]
|
||||
end
|
||||
|
||||
@set.run_command @ctx, 'foo', 1, 2, 3
|
||||
expect { |probe|
|
||||
@set.command('foo', &probe)
|
||||
@set.run_command(@ctx, 'foo', 1, 2, 3)
|
||||
}.to yield_with_args(1, 2, 3)
|
||||
end
|
||||
|
||||
it 'should use the first argument as context' do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue