rspec/rspec-core — pull request #815 by jalkoby (2013-03-05 15:17:07+00:00)
Title: allow activate defined `let` by `let!` without block

In last few months I have a lot specs of next structure:

```ruby
describe 'Some specs' do
let(:car) { create :car }

it "spec which doesn't need `car`" do

end

it "spec which need `car` not instantly" do
# some code
car.turn_left
# some code
end

context 'context which needs preloaded car' do
let!(:car) { create :car }

end

context 'another context which needs preloaded car' do
let!(:car) { create :car }

end
end
```
Above example shows us the duplication. Another solution for this problem might be next

```ruby
describe 'Some specs' do
let(:car) { create :car }

it "spec which doesn't need `car`" do

end

it "spec which need `car` not instantly" do
# some code
car.turn_left
# some code
end

context 'context which needs preloaded car' do
before { car }

end

context 'another context which needs preloaded car' do
before { car }

end
end
```
But using before make specs little bit unreadable.

My solution is using `let!` without block

```ruby
describe 'Some specs' do
let(:car) { create :car }

it "spec which doesn't need `car`" do

end

it "spec which need `car` not instantly" do
# some code
car.turn_left
# some code
end

context 'context which needs preloaded car' do
let!(:car)

end

context 'another context which needs preloaded car' do
let!(:car)

end
end
```
It activates defined `let` with lefting specs clean.