Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
zhangsu opened this issue Oct 31, 2015 · 0 comments
Open

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

zhangsu opened this issue Oct 31, 2015 · 0 comments

Comments

@zhangsu
Copy link
Owner

zhangsu commented Oct 31, 2015

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.

@zhangsu zhangsu changed the title Support expect(val1).to(be(boolean)) syntax Support expect(val1).to(be(bool)) syntax Oct 31, 2015
@zhangsu zhangsu changed the title Support expect(val1).to(be(bool)) syntax Support expect(val).to(be(bool)) syntax Oct 31, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant