<ANN> TeSLa, a Domain Specific Language for Unit Testing

J

James Britt

Hi
I just posted version 0.1.0 of TeSLa, a Domain Specific Language (DSL)
for Unit Testing.
You can download TeSLa along with a small example script from
http://theniceweb.com/projects/tesla/tesla.zip (zip)
or here
http://theniceweb.com/projects/tesla/tesla.tar.gz (tar.gz)
I also posted a small article/tutorial explaining the rationale and use
of TeSLa here
http://www.theniceweb.com/JaviersBlog/2005/10/tesla-test-specific-language-for-ruby.html

This looks quite interesting. Two questions:

1. How does this compare to behavior-driven development?

http://daveastels.com/index.php?p=5

2. The TeSLa docs give this example, comparing Test::Unit and TesLa:

class TestCatalog < Test::Unit::TestCase
def test_add_item
catalog = Catalog.new()
catalog.items = [:item1, :item2, :item3]
catalog.add_item :item4
assert_equal(catalog.size, 4, "length should be 4")
end
end

would look like this in TeSLa

test_method :add_item => [:item4] do
requires {@items = [:item1, :item2, :item3]}
assert {size == 4}
end


How does the TeSLa version know what :item4 is for, or where it goes, or
what 'size' refers to? The example has no reference to Catalog; how
does the code know to test that class?

Thanks,

James
--

http://www.ruby-doc.org - The Ruby Documentation Site
http://www.rubyxml.com - News, Articles, and Listings for Ruby & XML
http://www.rubystuff.com - The Ruby Store for Ruby Stuff
http://www.jamesbritt.com - Playing with Better Toys
 

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,999
Messages
2,570,246
Members
46,839
Latest member
MartinaBur

Latest Threads

Top