let!

1 view
Skip to first unread message

Alex Chaffee

unread,
Dec 5, 2012, 7:05:01 PM12/5/12
to groupiter-dev
RSpec has a let! method:

        # Just like `let`, except the block is invoked by an implicit `before`
        # hook. This serves a dual purpose of setting up state and providing a
        # memoized reference to that state.

So we can stop doing

  let(:foo){...)
  before{foo}

and just do

  let!(:foo){...}


--
Alex Chaffee - al...@stinky.com
http://alexchaffee.com
Reply all
Reply to author
Forward
0 new messages