Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Test::Unit: setup & teardown around an entire suite?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Michael Schuerig  
View profile  
 More options Jun 10 2005, 1:47 pm
Newsgroups: comp.lang.ruby
From: Michael Schuerig <mich...@schuerig.de>
Date: Fri, 10 Jun 2005 19:47:01 +0200
Local: Fri, Jun 10 2005 1:47 pm
Subject: Test::Unit: setup & teardown around an entire suite?

Is there a way to wrap setup and teardown methods around an entire
suite? I haven't seen explicit methods for this purpose, but maybe
there's an idiomatic way to achieve the same result.

Michael

--
Michael Schuerig                           The more it stays the same,
mailto:mich...@schuerig.de                        The less it changes!
http://www.schuerig.de/michael/      --Spinal Tap, The Majesty of Rock


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nathaniel Talbott  
View profile  
 More options Jul 9 2005, 11:06 am
Newsgroups: comp.lang.ruby
From: Nathaniel Talbott <nathan...@talbott.ws>
Date: Sun, 10 Jul 2005 00:06:29 +0900
Local: Sat, Jul 9 2005 11:06 am
Subject: Re: Test::Unit: setup & teardown around an entire suite?
On Jun 10, 2005, at 13:50 , Michael Schuerig wrote:

> Is there a way to wrap setup and teardown methods around an entire
> suite? I haven't seen explicit methods for this purpose, but maybe
> there's an idiomatic way to achieve the same result.

This is late, but here's something that will work:

   require 'test/unit'

   class T < Test::Unit::TestCase
     def setup
       p 'setup'
     end
     def teardown
       p 'teardown'
     end
     def test1
       p 'test1'
     end
     def test2
       p 'test2'
     end
     def self.suite
       s = super
       def s.setup
         p 'suite_setup'
       end
       def s.teardown
         p 'suite_teardown'
       end
       def s.run(*args)
         setup
         super
         teardown
       end
       s
     end
   end

I do plan on providing a better way to do that, but for now we can  
just lean on the extreme flexibility of Ruby.

HTH,

--
Nathaniel Talbott

<:((><


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google