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 

Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -