Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rspec; How to use should not include?

Tags:

ruby

rspec

Right now i am using not_to eq, how can i use should not include in following scenario?

Code:   
expect(object.method('param1')).not_to eq(array)

Console:    
expected: value != ["value1", "value2", 
    "value3","value4"]

got: ["value2", "value3"]
like image 412
Rashid Siddique Avatar asked Dec 07 '25 09:12

Rashid Siddique


1 Answers

You can use include matcher (docs)

expect(object.method('param1')).not_to include(*array)
like image 127
zishe Avatar answered Dec 08 '25 22:12

zishe