If you configure RSpec to not allow syntax, you can still use the old syntax with one layer, since it should not be added for each object:
describe User do it { should be_valid } end
We briefly discussed the alternative syntax with a single layer, but decided against it, because it is not needed, and we felt that this could add confusion. However, you can easily add this if you prefer the way it reads:
RSpec.configure do |c| c.alias_example_to :expect_it end RSpec::Core::MemoizedHelpers.module_eval do alias to should alias to_not should_not end
In doing so, you can write this as:
describe User do expect_it { to be_valid } end
Myron Marston Sep 04 2018-12-14T00: 00Z
source share