This matcher checks that given collection is included into the original collection, and in correct order. It accepts both strings and regexps.
Examples:
assert_includes_in_order(%w{1 2 3 4 5}, %w{1 3 5}) # => pass assert_includes_in_order(%w{1 2 3 4 5}, %w{1 5 3}) # => fail assert_includes_in_order(w{1 2 3 4 5}, ["1", /\d+/, "5"]) # => pass assert_includes_in_order(w{1 2 3 4 5}, ["1", /\[a-z]+/, "5"]) # => fail
# File lib/debugger/test/matchers.rb, line 13 def assert_includes_in_order(given_collection, original_collection, msg = nil) msg = message(msg) do "Expected #{mu_pp(original_collection)} to include #{mu_pp(given_collection)} in order" end assert includes_in_order_result(original_collection, given_collection), msg end
# File lib/debugger/test/matchers.rb, line 20 def refute_includes_in_order(given_collection, original_collection, msg = nil) msg = message(msg) do "Expected #{mu_pp(original_collection)} to not include #{mu_pp(given_collection)} in order" end refute includes_in_order_result(original_collection, given_collection), msg end
Generated with the Darkfish Rdoc Generator 2.