-
Notifications
You must be signed in to change notification settings - Fork 77
Closed
Description
Current containment assertions:
assert_that(['a','b']).contains('a')
assert_that(['a','b']).contains('b','a')
assert_that(['a','b']).is_equal_to(['a','b'])
assert_that(['a','b']).is_not_equal_to(['b','a'])
assert_that(['a','b']).does_not_contain('x','y')
assert_that(['a','b','c']).contains_sequence('b','c')
assert_that(['a','b']).is_subset_of(['a','b','c'])Matching all the items in a collection, where they could be out of order, is generally useful in testing, especially for things like sets or dict keys.
Add a contains_only() assertion (aka contains_exactly_but_in_any_order()), such that this passes:
assert_that(['a','b']).contains_only('b','a')And this fails:
assert_that(['a','b']).contains_only('a')Reactions are currently unavailable