The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
RSpec Organization and JUnit Pains

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Anders Bengtsson

Posts: 12
Nickname: ghostganz
Registered: Jun, 2006

Anders Bengtsson is a software developer
RSpec Organization and JUnit Pains Posted: Apr 15, 2007 3:29 AM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Anders Bengtsson.
Original Post: RSpec Organization and JUnit Pains
Feed Title: A View From Above: Ruby
Feed URL: http://www.ghostganz.com/blog/xml/rss20/category/Ruby/feed.xml
Feed Description: Anders Bengtsson on programming and other things
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Anders Bengtsson
Latest Posts From A View From Above: Ruby

Advertisement

When I first tried RSpec it felt like a good tool that forced you to write your tests in a form that’s very close to what’s considered best practice. There are a lot of ways to abuse Test::Unit or JUnit, but if you know what you’re doing you’re usually still close. RSpec was good enough for me to change to it, but didn’t feel like a big deal.

But after some time with RSpec I’m now writing a lot tests in Java again. What I realize is how hard it is to organize tests well in JUnit. The tool is fighting me all the way, you just can’t make simple tests easily. If you want to take full advantage of the setUp() methods you have to create a lot of classes. This quickly makes it hard to get an overview over your tests. It just can’t be compared to RSpec’s “context”. I believe JUnit’s way of having exactly one setUp() per class is the problem. Maybe some way of allowing multiple setUp() would be possible.

There are a lot of other differences between RSpec and JUnit, the conditions for example (assertTrue vs. should_eat_cake) and the naming of the test cases. But still the organization of the tests make a big difference. There’s nothing for Java that really does that today. Test NG does an attempt, but at the cost of a little more complexity. But there’s nothing preventing if from being done.

Read: RSpec Organization and JUnit Pains

Topic: DHH Responds to Stateful Web Applications Row Previous Topic   Next Topic Topic: how to use rspec rails plugin with zentest

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use