Method test::unit::TestSuite#<<(test)

Discussion in 'Ruby' started by Robert Klemme, Aug 6, 2003.

  1. Hi,

    I suggest to change the definition of this method slightly:

    current:
    # Adds the test to the suite.
    def <<(test)
    @tests << test
    end

    proposed:
    # Adds the test to the suite.
    def <<(test)
    @tests << test
    self
    end

    This way we can do:

    class TS_MyTests
    def self.suite
    Test::Unit::TestSuite.new <<
    TC_MyFirstTests.suite <<
    TC_MoreTestsByMe.suite <<
    TS_AnotherSetOfTests.suite
    end
    end

    Regards

    robert
    Robert Klemme, Aug 6, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Edvard Majakari
    Replies:
    4
    Views:
    672
    Edvard Majakari
    Feb 25, 2005
  2. VvanN
    Replies:
    5
    Views:
    475
    Phlip
    Apr 28, 2006
  3. billiejoex
    Replies:
    2
    Views:
    226
    billiejoex
    Sep 10, 2007
  4. Johan Holmberg
    Replies:
    7
    Views:
    155
    Johan Holmberg
    Sep 15, 2003
  5. timr
    Replies:
    2
    Views:
    151
Loading...

Share This Page