#51 √ committed
Ryan McGeary

Add a :before Proc to should statements

Reported by Ryan McGeary | July 8th, 2008 @ 09:32 PM

This branch adds an optional :before Proc option that can be passed to a should statement. The :before proc runs after all the parent context's setups but before the current context's setups.

(rmm5t/shoulda before_should)

http://github.com/rmm5t/shoulda/...

Example usage:

context "Some context" do
  setup { puts("I run after the :before proc") }

  should "run a :before proc", :before => lambda { puts("I run before the setup") }  do
    assert true
  end
end

This idea was discussion on the shoulda mailing list: http://groups.google.com/group/s...

The relevant commit: http://github.com/rmm5t/shoulda/...

Comments and changes to this ticket

Please Login or create a free account to add a new comment.

You can update this ticket by sending an email to from your email client. (help)

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

People watching this ticket