Toggle between multi-line do-end and single line braces blocks.
With your cursor on the let(:bar)
line, use command menu to pick Ruby Block Toggle
.
RSpec.describe(Foo) do
let(:bar) { create(:bar, name: 'yo') }
end
# becomes
RSpec.describe(Foo) do
let(:bar) do
create(:bar, name: 'yo')
end
end
# and vice versa
This doesn't play well with blocks that have code chained onto it
foos.each { |foo| foo.something }.map(&:other_stuff)
The .map(&:other_stuff)
gets removed... working on it.