interesting test tool... looking for opinions.

Discussion in 'Ruby' started by Jeff Wood, Aug 3, 2005.

  1. Jeff Wood

    Jeff Wood Guest

    There is wonderful java-based testing unit framework called TestNG.

    I'd love to see it's extensions to the standard xUnit style testing
    get incorporated into our TestUnit objects...

    Anyways, if/when any of you that care to, have the time, please take a
    look at TestNG and let me know what you think of the idea of something
    like that becoming the standard for Ruby?

    Thanks ... I know I'm not in any place of power, but I just wanted to
    see what people think.

    j.

    --=20
    "So long, and thanks for all the fish"

    Jeff Wood
     
    Jeff Wood, Aug 3, 2005
    #1
    1. Advertisements

  2. http://www.beust.com/testng/ appears to be the home page. What might
    be useful is forwarding this to Nathaniel Talbott to see what he's
    done toward creating the test/unit next generation code that he
    presented last year at RubyConf and maybe see if the ideas with this
    can be expressed in code that fits with his ideas. It might also be
    worth going over the ideas that he's had with test/unit from last
    year's presentation. I *think* Ryan Davis archives the presentations
    at zenspider.org.

    -austin
    --=20
    Austin Ziegler *
    * Alternate:
     
    Austin Ziegler, Aug 3, 2005
    #2
    1. Advertisements

  3. Jeff Wood

    Jeff Wood Guest

    There is also a really good section in PickAxe2 on metaprogramming.

    j.


    --=20
    "So long, and thanks for all the fish"

    Jeff Wood
     
    Jeff Wood, Aug 4, 2005
    #3
  4. Attributes, metadata on methods are one of the things C# gave me that
    I truely miss.
    Maybe because I dont know ruby that well yet ...


    --=20
    Reyn Vlietstra
     
    Reyn Vlietstra, Aug 4, 2005
    #4
  5. #: Reyn Vlietstra changed the world a bit at a time by saying on 8/4/2005 12:07 PM :#
    Does anyone still has the reference to the why blog entry about metadaata? thanks a lot

    :alex |.::the_mindstorm::.|
     
    Alexandru Popescu, Aug 4, 2005
    #5
  6. Jeff Wood

    Jeff Wood Guest

    http://redhanded.hobix.com/inspect/seeingMetaclassesClearly.html


    --=20
    "So long, and thanks for all the fish"

    Jeff Wood
     
    Jeff Wood, Aug 4, 2005
    #6
  7. Jeff Wood

    Phil Tomson Guest

    Why couldn't you add metadata to methods?

    class Metod
    def metadata
    @metadata
    end

    def metadata= data
    @metadata = data
    end
    end

    def foo
    "foo"
    end


    foometh = self.method:)foo)

    foometh.metadata = "This method just says foo"

    puts foometh.metadata #=> This method just says foo


    Phil
     
    Phil Tomson, Aug 4, 2005
    #7
  8. #: Phil Tomson changed the world a bit at a time by saying on 8/4/2005 9:16 PM :#
    That was exactly what I have thought ... but haven't the means to express it. Thanks Phil.

    :alex |.::the_mindstorm::.|
     
    Alexandru Popescu, Aug 4, 2005
    #8
  9. Jeff Wood

    Phil Tomson Guest

    Even better:

    irb(main):001:0> class Object
    irb(main):002:1> def metadata
    irb(main):003:2> @metadata
    irb(main):004:2> end
    irb(main):005:1> def metadata= data
    irb(main):006:2> @metadata = data
    irb(main):007:2> end
    irb(main):008:1> end
    irb(main):021:0> class Foo
    irb(main):022:1> def sayfoo
    irb(main):023:2> "foo I said"
    irb(main):024:2> end
    irb(main):025:1> end
    => nil
    irb(main):026:0> Foo.metadata = "This is a Foo class"
    => "This is a Foo class"
    irb(main):027:0> Foo.metadata
    => "This is a Foo class"


    That way you can put metadata on (just about) any object.

    Phil
     
    Phil Tomson, Aug 4, 2005
    #9
  10. Jeff Wood

    Jeff Wood Guest

    The only thing I don't like about that solution is that you define the
    metadata outside the method body.

    I really think we should keep them together. Otherwise we're just
    asking for things to get out of sync.

    j.


    --=20
    "So long, and thanks for all the fish"

    Jeff Wood
     
    Jeff Wood, Aug 4, 2005
    #10
  11. Phil Tomson wrote:
    ...
    foometh2 = self.method:)foo)

    puts foometh2.metadata #=> nil

    The metadata doesn't really stay with the method, only with the Method
    instance.
     
    Joel VanderWerf, Aug 4, 2005
    #11
  12. Jeff Wood

    Jeff Wood Guest

    if we do it that way, all we then need for the function attributes is
    a way to get a reference to the method we're in the middle of
    defining.

    def foo
    foo.metadata =3D "the foo function"
    end

    or something like that.

    j.


    --=20
    "So long, and thanks for all the fish"

    Jeff Wood
     
    Jeff Wood, Aug 4, 2005
    #12
  13. Jeff Wood

    Niki Guest

    Is this implementation available now? I am newbie to ruby and have built a automation framework using selenium webdriver in ruby. Is it possible to use TestNg with ruby? Are there some tutorials available?

    Thanks!!
     
    Niki, Feb 6, 2013
    #13
  14.  
    garciaaugusto, Apr 28, 2014
    #14
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.