dimanche 24 janvier 2016

Rspec - Specifying the number and class of method arguments

I'm trying to write a unit test whereby a particular method is expected to be called with a single argument of a specific class.

Something like:

expect(subject).to respond_to(:method1).with(instance_of(Class1))

I know I can expect a single argument with respond_to(:method1).with(1).argument, but how can I also expect its class?

Aucun commentaire:

Enregistrer un commentaire