# Fixtures question - run \*before\* every test method?

**URL:** <https://www.ruby-forum.com/t/fixtures-question-run-before-every-test-method/106880>\
**Category:** Rails\
**Created:** [June 14, 2007, 11:42pm UTC](https://www.ruby-forum.com/t/fixtures-question-run-before-every-test-method/106880 "2007-06-14T23:42:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wpwood](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d6d6ee/32.png) [@wpwood](https://www.ruby-forum.com/u/wpwood)\
**Post date:** [June 14, 2007, 11:42pm UTC](https://www.ruby-forum.com/t/fixtures-question-run-before-every-test-method/106880/1 "2007-06-14T23:42:19Z")

</div>

I just noticed a behavior that makes me wonder exactly what the sequence  
of events is when unit tests are run. All the stuff I’ve read says that  
before every test method all the rows in the table get deleted and the  
fixtures get ‘run’ to load the table. What I noticed today is that  
_after_ the execution of a test case, the table contents are exactly  
what’s specified in the fixture. That leads me to wonder exactly what  
triggers the execution of the code that uses the fixtures. Seems like  
maybe the first execution is triggered by encountering a ‘def’ and after  
that execution is triggered by encountering an ‘end’. Anybody know? Or  
know where I should look?

Thanks,  
Bill
