interesting test tool... looking for opinions.

J

Jeff Wood

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
 
A

Austin Ziegler

There is wonderful java-based testing unit framework called TestNG.
=20
I'd love to see it's extensions to the standard xUnit style testing
get incorporated into our TestUnit objects...
=20
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?
=20
Thanks ... I know I'm not in any place of power, but I just wanted to
see what people think.

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 * (e-mail address removed)
* Alternate: (e-mail address removed)
 
J

Jeff Wood

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

j.

#: Jeff Wood changed the world a bit at a time by saying on 8/4/2005 9:0= 6 AM :#
=20
I think I have tried that article a couple of times, but my Ruby understa= nding was pretty young at
that moment. Maybe I will try it again.
=20
:alex |.::the_mindstorm::.|
=20
=20
=20
=20


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

Jeff Wood
 
R

Reyn Vlietstra

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 ...

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

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


--=20
Reyn Vlietstra
 
A

Alexandru Popescu

#: Reyn Vlietstra changed the world a bit at a time by saying on 8/4/2005 12:07 PM :#
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 ...

Does anyone still has the reference to the why blog entry about metadaata? thanks a lot

:alex |.::the_mindstorm::.|
 
P

Phil Tomson

No, you can't attach metadata to methods, but you can attach them to the
class or module where the methods are defined. I think this should be
enough for something like TestNG. For more info look into the archives
of ruby-talk or ruby-core (I don't remember where).

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
 
A

Alexandru Popescu

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

:alex |.::the_mindstorm::.|
 
P

Phil Tomson

#: 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.

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
 
J

Jeff Wood

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.

#: 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.
=20
:alex |.::the_mindstorm::.|
=20
=20


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

Jeff Wood
 
J

Joel VanderWerf

Phil Tomson wrote:
...
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

foometh2 = self.method:)foo)

puts foometh2.metadata #=> nil

The metadata doesn't really stay with the method, only with the Method
instance.
 
J

Jeff Wood

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
Even better:
=20
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=3D data
irb(main):006:2> @metadata =3D 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
=3D> nil
irb(main):026:0> Foo.metadata =3D "This is a Foo class"
=3D> "This is a Foo class"
irb(main):027:0> Foo.metadata
=3D> "This is a Foo class"
=20
=20
That way you can put metadata on (just about) any object.
=20
Phil
=20
=20
=20


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

Jeff Wood
 
N

Niki

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!!
 
G

garciaaugusto

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!!



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


def foo
foo.metadata = "the foo function"

or something like that.

#: Phil Tomson changed the world a bit at a time by saying on 8/4/2005
9:16 PM :#

I am also very interested in a TestNG solution for Ruby. Please let me know if there one

Thanks
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top