# Setup and Teardown

**URL:** <https://www.ruby-forum.com/t/setup-and-teardown/119700>\
**Category:** Ruby\
**Created:** [November 9, 2007, 11:54am UTC](https://www.ruby-forum.com/t/setup-and-teardown/119700 "2007-11-09T11:54:22Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![tcblues](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/db5fbb/32.png) [@tcblues](https://www.ruby-forum.com/u/tcblues)\
**Post date:** [November 9, 2007, 11:54am UTC](https://www.ruby-forum.com/t/setup-and-teardown/119700/1 "2007-11-09T11:54:22Z")

</div>

I was wondering… There are so many different ways to setup and  
teardown in the Test Cases thing!!!  
So I thought maybe could be a very good idea to open a new topic about  
that and people contribute with their ideas about how to implement the  
setup and teardown in a typical test case.

Let’s go.

---

<div class="post-metadata">

**Author:** ![tcblues](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/db5fbb/32.png) [@tcblues](https://www.ruby-forum.com/u/tcblues)\
**Post date:** [November 10, 2007, 12:40am UTC](https://www.ruby-forum.com/t/setup-and-teardown/119700/2 "2007-11-10T00:40:16Z")

</div>

On Fri, Nov 09, 2007 at 07:54:20PM +0900, Mario R. wrote:

> I was wondering… There are so many different ways to setup and  
> teardown in the Test Cases thing!!! So I thought maybe could be a very

Are there? I’m only aware of setup() and teardown(), which seem to  
create a lot of overhead when running testcases that just contain  
assertions without modifying anything.

What other ways are there of creating fixtures?

---

<div class="post-metadata">

**Author:** ![tcblues](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/db5fbb/32.png) [@tcblues](https://www.ruby-forum.com/u/tcblues)\
**Post date:** [November 10, 2007, 1:22am UTC](https://www.ruby-forum.com/t/setup-and-teardown/119700/3 "2007-11-10T01:22:57Z")

</div>

On Nov 9, 2007, at 15:39 , Todd A. Jacobs wrote:

> Are there? I’m only aware of setup() and teardown(), which seem to  
> create a lot of overhead when running testcases that just contain  
> assertions without modifying anything.

what overhead?

---

<div class="post-metadata">

**Author:** ![tcblues](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/db5fbb/32.png) [@tcblues](https://www.ruby-forum.com/u/tcblues)\
**Post date:** [November 12, 2007, 10:44am UTC](https://www.ruby-forum.com/t/setup-and-teardown/119700/4 "2007-11-12T10:44:15Z")

</div>

A few links about this:  
[http://www.agileprogrammer.com/dotnetguy/articles/SetupTeardown.aspx](http://www.agileprogrammer.com/dotnetguy/articles/SetupTeardown.aspx)

[http://codebetter.com/blogs/scott.bellware/archive/2007/09/21/168390.aspx](http://codebetter.com/blogs/scott.bellware/archive/2007/09/21/168390.aspx)

[http://www.codeproject.com/csharp/autp4.asp](http://www.codeproject.com/csharp/autp4.asp)

---

<div class="post-metadata">

**Author:** ![tcblues](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/db5fbb/32.png) [@tcblues](https://www.ruby-forum.com/u/tcblues)\
**Post date:** [November 12, 2007, 10:45am UTC](https://www.ruby-forum.com/t/setup-and-teardown/119700/5 "2007-11-12T10:45:59Z")

</div>

A few links about this:

[http://www.agileprogrammer.com/dotnetguy/articles/SetupTeardown.aspx](http://www.agileprogrammer.com/dotnetguy/articles/SetupTeardown.aspx)  
[http://codebetter.com/blogs/scott.bellware/archive/2007/09/21/168390.aspx](http://codebetter.com/blogs/scott.bellware/archive/2007/09/21/168390.aspx)  
[http://www.codeproject.com/csharp/autp4.asp](http://www.codeproject.com/csharp/autp4.asp)

---

<div class="post-metadata">

**Author:** ![tcblues](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/db5fbb/32.png) [@tcblues](https://www.ruby-forum.com/u/tcblues)\
**Post date:** [November 12, 2007, 6:15pm UTC](https://www.ruby-forum.com/t/setup-and-teardown/119700/6 "2007-11-12T18:15:21Z")

</div>

On Nov 9, 2007, at 3:54 AM, Mario R. wrote:

> I was wondering… There are so many different ways to setup and  
> teardown in the Test Cases thing!!!

by so many do you mean two? 1 - setup. 2 - teardown. ?

> So I thought maybe could be a very good idea to open a new topic about  
> that and people contribute with their ideas about how to implement the  
> setup and teardown in a typical test case.

def setup  
end

def teardown  
end

??

a @ [http://codeforpeople.com/](http://codeforpeople.com/)

---

<div class="post-metadata">

**Author:** ![tcblues](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/db5fbb/32.png) [@tcblues](https://www.ruby-forum.com/u/tcblues)\
**Post date:** [November 12, 2007, 11:16am UTC](https://www.ruby-forum.com/t/setup-and-teardown/119700/7 "2007-11-12T11:16:55Z")

</div>

On Nov 12, 2007, at 01:45 , Mario R. wrote:

> A few links about this:
> 
> [http://www.agileprogrammer.com/dotnetguy/articles/SetupTeardown.aspx](http://www.agileprogrammer.com/dotnetguy/articles/SetupTeardown.aspx)  
> [http://codebetter.com/blogs/scott.bellware/archive/2007/09/21/168390.aspx](http://codebetter.com/blogs/scott.bellware/archive/2007/09/21/168390.aspx)  
> [http://www.codeproject.com/csharp/autp4.asp](http://www.codeproject.com/csharp/autp4.asp)

“dotnetguy”, “csharp”, ‘clever’ quips like “Setup and teardown methods  
attract entropy faster than an outsource programmer with his first  
patterns book”…

Lots of words, but… How is ANY of this applicable?

As far as I can tell, we’ve got setup, and teardown… and that’s it.  
No magic, just plain old ruby code.
