Skip to content

Support expect(val).to(be(bool)) syntax #5

@zhangsu

Description

@zhangsu

Sometimes it's more readable to say

expect(...).to(be(true))
expect(...).to(be(false))

than to say

expect(...).to(be_truthy)
expect(...).to(be_falsey)

When we are sure that the subject must be true (1) or false (0), we should be able to use the be(true) and be(false) syntax to match the exact value, instead of matching non-zero for "truthy" and zero for "falsey". We should be able to do this by overloading the Be#match template method with boolean parameter type.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions