We’re going global with this baby…
A discussion recently started on the comp.lang.ruby mailing-list about the
possibility to
port TestNG to Ruby.
While Ruby doesn’t support annotations natively, it’s actually quite easy to
simulate and both Aslak and a participant
of this thread have posted a technique to add annotations to Ruby. For
example:
config :after_test => true
def teardown
puts "Test2#teardown called"
endtest :groups => ['one']
def test_method1
puts "Test2#test_method1 called"
end
This trick relies on the fact that it’s possible to add definitions to
Class in Ruby. The annotations config and test
above are actually real methods that update fields added to the Class
class. When one of these methods is encountered in a Class
definition, it is parsed and then silently discarded so it never actually gets
added to the Class definition. This is made possible by
overriding the method_added method of the Class class, where
you can control what to do whenever a new method definition is found by the
parser.
You can find the full listing for an example implementation of this technique
in
this message from Ryan Leavengood.
I also suggested to replace testng.xml with a Ruby file containing
these definitions (the Ruby community is usually not very friendly to XML file,
and I can certainly sympathize with this feeling).
I’m curious to see where all this will lead…
#1 by John Rogers on August 4, 2005 - 9:20 am
Lately I have been reading some blogs about the relative merits of various scripting languages. I see many performance comparisions and debates made between Python, Perl, TCL, Ruby and Java. However, I cannot remember even one instance where Euphoria was included. I would like to know why the Euphoria programming language never seems to get considered as a viable contender in any of these discussions.
#2 by Funky Monkey on August 4, 2005 - 2:03 pm
re: Euphoria
Probably because most people never even heard of it. There are literally thousands of scripting languages available. Only a half dozen at best will ever be commonly known.
Oh, and the quality of the scripting language has little to do with it’s popularity.
#3 by Sumit on August 4, 2005 - 2:40 pm
In the same vein, I would like to know why Ecstasy was not included. This was a scripting language I wrote for a term project back in college.
#4 by Michael Kovacs on August 4, 2005 - 6:20 pm
Cedric,
Please give me a project.
Thanks,
-Michael
#5 by Puroshatttam on August 5, 2005 - 6:38 am
Sir u have to gime me Java project!
I’m waiting
#6 by Alain Rogister on August 5, 2005 - 12:05 pm
I *am* anxiously waiting for the Malbolge port (http://www.lscheffer.com/malbolge.html)
#7 by Sumit on August 5, 2005 - 7:33 pm
The Malbolge port, yu Indians, might be an excellent project.