Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

raise_error does not support a matcher as first argument being matched against the message #762

@myronmarston

Description

@myronmarston

raise_error supports composable matchers:

  • The first arg is matched against the exception object, supporting things like this.
  • The 2nd arg is matched against the exception message, supporting things like a_string_including(...).

Sometimes you only care about matching on the string, though. raise_error partially supports this by allowing you to pass a regex as the first argument. I think we should similarly support a matcher matching against the message as the first argument. Basically, we would change raise_error so that when it receives a single argument, it passes if that argument matches against either the exception object itself or the message.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions