-
-
Notifications
You must be signed in to change notification settings - Fork 394
Consider renaming be_true
and be_false
to be_truthy
and be_falsey
#283
Comments
👍 I could implement this tomorrow if we're there right now, or do you want to get some community feedback first? |
👍 |
I think this is a good idea. |
@samphippen's PR's LGTM, but I'm not really in favour of this change, I've never liked 'Truthy' or 'Falsey' as terms so I kind of feel it's a backwards step in terms of language for some extra pedantry... I've always used That said I'd have nothing against adding |
I agree with @JonRowe - truthy/falsey are unlikely to be expected to exist, where I also know that this change will affect a LOT of people. Is it adding enough value to make it worth it? I don't think so. |
I'm on the fence. I realized there is some parity with Jasmine having |
Maybe I'm an exception, but I think of non-nil, non-false objects as "being treated as true", but I don't think of them as "being true". I think it's also quite confusing that the semantics and meaning of All that said, maybe we should invite community discussion on this? I can mention and link to this from the rspec 3 blog post that'll be going live next week if you like. |
@JonRowe -- if we move this direction, I'd definitely want |
I agree. It definitely confused me at first. Given Ruby is a strongly typed language,
I'm a little concerned about community discussion here because I'm not sure what other rationale could be brought up at this point other than personal preferences and personal ways of internalizing true/false in Ruby. We might cause a lot of useless noise over it? But I might be thinking too hard. |
Well, I don't disagree with @myronmarston 's points, I guess it's positive to remove the ambiguity between |
Given that there are some results for both, maybe we alias them? |
In fairness I believe Falsey gets used as a surname, so there's that... |
Injecting opinions: I agree with @alindeman, I don't think we need to do a community consult here (for the reasons he listed). I do think we should alias falsey and falsy. I do think we should remove be_true and be_false with deprecation period in 2-99 (otherwise we're obliged to keep them until 4). |
An alternative way of removing confusion would be to make Although if we do go with this my 2¢ is that I'd favour |
I think this would increase confusion. The I like the idea of aliasing |
This has been addressed. |
Rspec 3 deprecates `be_true` and `be_false` because they actually behave like `be_truthy` and `be_falsey`[1]. This commit uses changes them to match exactly true or false. [1] rspec/rspec-expectations#283
* In RSpec 3, `be_false` and `be_true` are deprecated in favor of * `be_falsey` and `be_truthy` * Source: rspec/rspec-expectations#283 * `be_falsy` works but is just an alias for `be_falsey` so we should prefer the latter
* In RSpec 3, `be_false` and `be_true` are deprecated in favor of `be_falsey` and `be_truthy` * Source: rspec/rspec-expectations#283 * `be_falsy` works but is just an alias for `be_falsey` so we should prefer the latter
`be_true` and `be_false` were deprecated in `rspec-2.99` and removed in `rspec-3.0`. rspec/rspec-expectations#283
`be_true` and `be_false` were deprecated in `rspec-2.99` and removed in `rspec-3.0`. rspec/rspec-expectations#283
I've heard some grumbling about this recently, and I've always found it a bit puzzling as well.
be_true
andbe_false
really act likebe_truthy
andbe_falsey
but aren't named as such. I think lots of folks thinkbe_true
passes if and only if the value istrue
, andbe_false
passes if and only if the value isfalse
but that's not the case. You can already dobe true
andbe false
(no underscore) for the exact match, so I don't think there's any need to change the semantics ofbe_true
andbe_false
-- instead, I'd like to deprecate them, in favor ofbe_truthy
andbe_falsey
, which are more accurately named. Thoughts?The text was updated successfully, but these errors were encountered: