Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

assert_not_in_array

We have an assertion in rails tests assert_in_array that is used to check if an element exists in an array. Is there any reverse assertion for it like assert_not_in_array?

like image 944
qasimzee Avatar asked Dec 02 '22 03:12

qasimzee


1 Answers

There is no such assertion, however you could do this:

assert (not array.include? element)
like image 166
Jacob Relkin Avatar answered Dec 14 '22 23:12

Jacob Relkin