How can I describe RSpec test to check if the array doesn't include some value? Something like this:
tags.should include("one")
tags.should not include("two")
I can rewrite my condition:
tags.include?("two").should be_false
but I'm looking for more beautiful solution.
for Rspec v3:
expect(my_string).to include "some value"
expect(my_string).not_to include "some value"
RSpec has should_not
as well as should
.
tags.should include("one")
tags.should_not include("two")
Here some more examples of the include matcher.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With