This is great news. RSpec is the bomb. I'm using it extensively at work and in my personal work. One of the committers is my co-worker, and we met the original author (Steven Baker) at the last RubyConf. Here's a video interview with him and Dave Astels (the guy who wrote the book on TDD and came up with the concept for BDD):
http://www.infoq.com/news/2007/04/announce-astels-baker-interview It'll be interesting to see how far they can get with this in Java/Groovy. RSpec relies heavily on Ruby magic for it's coolness and ease-of-use. -- Chad On 4/11/07, Warner Onstine <[EMAIL PROTECTED]> wrote:
This was sent out to the Groovy list this morning, an implementation of Behavior Driven Development, inspired by RSpec (http:// rspec.rubyforge.org/), This one is of course called GSpec. http://codeforfun.wordpress.com/2007/04/09/gspec-for-java-bdd/ Here's the code example he sent to the list: > GSpec is still very alpha as I need to rework the method and property > interception, however I'm putting it out there in an attempt to > draw some > interest (more so in the practice rather than the project). Honestly I > should be spending more time developing and fixing the kinks in > GSpec than I > spend writing about it. Currently I'm working on using Groovy MOP for > interception and I'm also now working on a term definition feature. > The idea > behind term definition is a means of allowing users to extend GSpec by > defining additional grammar at runtime. Here's what it wold look like: > > the.context("A music store order entry system") { > definitions { > define 'accepted' { the.orderRepository.contains(it) } > } > > initially { > the.orderRepository = new OrderRepositoryImpl() > the.orderProcessor = new OrderProcessorImpl() > } > > specify("An order posted without items should NOT be accepted") { > def order = the.orderProcessor.createOrder() > order.submit() > order.should_not_be_accepted > } > > specify("An order posted with items SHOULD be accepted") { > def order = the.orderProcessor.createOrder() > order.add new LineItem("MC Hammer's greatest hits Double CD", > 21.99) > order.submit() > order.should_be_accepted > } > > inConclusion { the.orderRepository.deleteAllOrders() } > } > > Here's what happens. Any term behind the magic properties (i.e. > should_be, > should_not_be) is considered as a boolean bean property. If the > property is > undefined on the calling object then a list of "terms" supplied by > the user > in the definition section will be considered to resolve the call. I > think > it's pretty slick stuff. You probably think I'm crazy, but it might > work > out. Drop me a line if you have any other ideas to throw into the pot. Warner Onstine - Programmer/Author New book! Tapestry 101 available at http://sourcebeat.com/books/ tapestrylive.html [EMAIL PROTECTED] http://warneronstine.com/blog --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]