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
Post a Comment