ruby - How to expect some (but not all) arguments with RSpec should_receive? -


class foo   def bar(a, b)   ...  foo.should_receive( :bar ) 

expects bar called arguments.

foo.should_receive( :bar ).with( :baz, :qux ) 

expects :baz , :qux passed in params.

how expect first param equal :baz, , not care other params?

use anything matcher:

foo.should_receive(:bar).with(:baz, anything) 

Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

java.util.scanner - How to read and add only numbers to array from a text file -

iphone - Three second countdown in cocos2d -