testez
testez copied to clipboard
.greater.than and .less.than
Currently too unnatural to read:
expect(x > 0).to.equal(true)
This falls apart once we consider >= and <= -- .greater.than.or.equal.to falls apart in the middle (or is a keyword)
That's true, I forgot about >= and <=. Will readability have to suffer in favor of functionality?
greater_than, less_than
greater_than.or_equal_to, less_than.or_equal_to?
I suspect the best solution to this problem will be to make camelCase versions of everything be the default or radically change the assertion syntax.
expect(x).toBeGreaterThan(3) seems fine, especially if we can preserve all of the flexibility of the current syntax?
https://github.com/Roblox/testez/issues/67
Currently too unnatural to read:
expect(x > 0).to.equal(true)
The assertion description is no good from this:
Expected value "true" (boolean), got "false" (boolean) instead
Plain assertions fare better. Simple numerical comparison should be a given; batteries included.
The argument about or can be avoided the same way we got around not being a keyword.
expect(x >= 0).to.equal(true)
is
expect(x).never.less.than(0)