The documentation really explains nicely how contains_sequence is supposed to behave with characters, strings with characters, but not strings with strings.
For example (expected):
# I would expect this to pass (needle and haystack appear as substrings in order)
assert_that("The needle is always in the haystack.").contains_sequence("needle", "haystack")
# I would expect this to fail (needle appears BEFORE haystack)
assert_that("The needle is always in the haystack.").contains_sequence("haystack", "needle")
Actual:
AssertionError: Expected <The needle is always in the haystack.> to contain sequence <'needle', 'haystack'>, but did not.
AssertionError: Expected <The needle is always in the haystack.> to contain sequence <'haystack', 'needle'>, but did not.
Now I'm not sure if I didn't understand it correctly or if this is a bug. Either way, it would be great to add some examples where there are two string sequences in the documentation.
The documentation really explains nicely how
contains_sequenceis supposed to behave with characters, strings with characters, but not strings with strings.For example (expected):
Actual:
Now I'm not sure if I didn't understand it correctly or if this is a bug. Either way, it would be great to add some examples where there are two string sequences in the documentation.