jeudi 27 septembre 2018

Wildcard parameter when using "expects(x).with" in Mocha testing

I am using Mocha testing in a rails application and am attempting to test a method that takes 3 parameters. I want to verify that two of those parameters are what I expect however I don't care about what the third is.

Ex: Resque.expects(:enqueue).with(GithubLoggerJob,*,"Update: Updated Name")

I don't care what is passes into the spot where the asterix is. Is there any way to ignore that and just verify that GithubLoggerJob and Update: Updated Name are passed in? Thanks.

Aucun commentaire:

Enregistrer un commentaire