rspec-expectations
rspec-expectations copied to clipboard
Deprecation request: RSpec::Matchers#be with no arguments
https://github.com/rspec/rspec-expectations/blob/master/lib/rspec/matchers.rb#L320-L322 https://github.com/rspec/rspec-expectations/blob/master/lib/rspec/matchers/built_in/be.rb#L104-L106
I think that the following:
expect(foo).to be
Should be deprecated, in favour of:
expect(foo).to be_truthy
The existence of the former has just caused me some pain, since someone had written the following test:
expect(json.size).to be ## (they forgot to specify a number!!!)
- And the test was silently passing, despite testing nothing of any use! (They could have used eq rather than be, which would have immediately highlighted the problem, but oh well.)
Is there a genuine use case I've not thought of, or can we get rid of this argument-free signature of the method?