ruby on rails - rspec matcher on array argument similar to hash_including -
in rspec can test call method receives argument hash , includes keys, or key-value pairs. is:
my_object.should_receive(:my_method).with(hash_including(:a => 'alpha'))
is there available accomplish similar match array? like?
my_object.should_receive(:my_method).with(array_including('alpha'))
how this:
my_obj.should_receive(:my_method) |arg| arg.should be_an_instance_of(array) arg.should include('alpha') end