samedi 5 décembre 2015

Rspec allow_any_instance_of to return instance id

Is it possible to do something like this???

allow_any_instance_of(Object).to receive(:foo).and_return("hello #{instance.id}")

Can i return a message depending on instance?

Aucun commentaire:

Enregistrer un commentaire