Skip to content

[Feature Idea] Combine context and let into one method.

Created by: yazumoto

When we use rspec, we often write code like below.

context 'When name is Mike' do
  let(:name) { 'Mike' }
  ...
end

In this case, context and let say same thing. If this will be one line, its easy to write and read.

So, I propose a method with .

with(:name, 'Mike') do
   ...
end

This code have same meaning of the code above.

How do you think about this? @rspec/rspec

Merge request reports