Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
"Not have keys" assertion seems unintuitive #254
If I write:
expect(obj).to.not.have.keys('password', 'secret', 'token');
You'd think it would fail if the object had any of those keys. But it actually passes even if it has one or more of them... as long as it doesn't have all of them.
I get why this is: because
But this bit me pretty hard just now, and I wonder if you guys would be open to special-casing this negative assertion to be the more defensive one — and arguably more intuitive and useful as well.