Open ConradIrwin opened 15 years ago
Agreed the == operators type coercion is a tricky thing to deal with in javascript testing frameworks almost all the frameworks I've looked at handle their equal and be matchers differently. Some of these issues you stated are fixed in my or other peoples forks of screw-unit they just haven't been pull into blue ridge yet.
I'll be updating Screw.Unit soon, so I'll try to find a patch that fixes this. Thanks for the heads up Conrad and Kristopher.
in javascript: 0, 0.0, null, undefined, '', ' ', etc. all evaluate to false when cast to a boolean, and almost everything else evaluates to true. the be_true and be_false method should not just check actual and !actual, but (actual === true) and (actual === false).
A similar issue is present with be_null, be_undefined and equal, (false == 0, false !== 0, null == undefined, but null !== undefined).