On Jan 21, 2011, at 10:32 AM, JDeville wrote:

> I'd like to be able to test w/ this methodology, and i'm having
> trouble figuring out where to hook in to rspec to do it.  Near as I
> can tell, the flow is this:
> 
> run all of the before filters in the order of highest to lowest
> context
> 
> <<--  I need to run something right here
> 
> run tests
> 
> run all of the after filters in the order of highest to lowest context
> 
> Is there any way to create a before filter that is always run after
> all of the others?

This sounds complicated.

In BDD, we use Given/When/Then to mean what you mean by AAA. You can do this 
all right in the example:

it "does something" do
  # given
  # when
  # then
end

You can use before hooks to set up the givens if you want (though be careful, 
as this is widely abused leading to less readability), but the when and then 
should be right in the example.

HTH,
David
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to