easyb 0.8 Released

Recently the release of easyb 0.8 was announced and including many exciting new features which are well summarized by Andy Glover on his blog. Since I’m very interested in using easyb to capture user stories and acceptance criteria in an expressive and executable manner I’m particularly excited about support for pending behavior definitions and HTML story report generation. I’m also jazzed about the IntelliJ plugin because it makes running easyb specs as easy as running a JUnit test from with the IDE.

The pending support is great because as create acceptance criteria together with a requirements donor (hint, hint) the intent behind criteria can be very quickly captured with a minimal of other syntactic clutter. The story is basically a simple text document at this point and might look like this:

scenario 'withdraw funds from ATM', {
	given 'an account balance of $100'
	when 'a customer withdraws $75'
	then 'that customers account balance should be 25'
}

When you run this with easyb the run is reported as:

Running test story (TestStory.groovy)
Scenarios run: 1, Failures: 0, Pending: 1, Time Elapsed: 0.368 sec

1 behavior run with no failures

When you’re ready to make this scenario executable (it you decide to do so at all) you can simply add closures to bind the scenario to the system under test:

scenario "withdraw funds from ATM", {
	given "an account balance of $100", {
		account = new Account()
	}
	when "a customer withdraws $75", {
		account.withdraw(75)
	}
	then "that customer's account balance should be $25", {
		account.balance.shouldBe(25)
	}
}

Using the maven plugin you can generate story documentation as a part of the build. The documentation generated for this story looks like:

Notice that the name of the specification is colored yellow. This indicates that the story is pending. Green and red are of course used to indicate successful and failing scenarios. Writing and automating testing of acceptance criteria doesn’t get any easier then that!

5 Responses

  1. Hello Rod.
    I am really interested in using easyb in a side open source project to familiarize myself with it and potentially bring into work. However the maven2 plugin doesn’t appear to be available from the repo documented here: http://www.easyb.org/running.html#maven

    The repo suggested is http://www.easyb.org/repo/.
    When I try to browse that URLhttp://www.easyb.org/repo/ I get a Forbidden response.

    I know I could download and install it manually, but so would anyone else who would potentially build my open source project; which is something I would like to prevent.

    Anyway you could get the maven plugin publicly available?

    James Lorenzen - April 8th, 2008 at 8:09 pm
  2. Hi James,

    I am glad to hear that you are interested in easyb! Unfortunately the easyb maven repository isn’t browseable. That means if you navigate to http://www.easyb.org/repo you’ll get a permission error. But if you navigate to http://www.easyb.org/repo/org/easyb/easyb/0.8/easyb-0.8.pom you’ll get the pom file. Maven requests artifacts individually so this isn’t a problem. Are you receiving any specific errors from maven?

    Also, easyb 0.7 is in maven central and I hope to get 0.8 there soon as well.

    rcoffin - April 9th, 2008 at 4:28 am
  3. Ok,
    I figured out the problem. You need to include the pluginRepositories section in your pom. Otherwise maven2 will just try maven central.

    So add the following:

    easyb
    http://www.easyb.org/repo/

    You might update your running easyb with maven to include it and the maven-easyb-plugin site as well.

    It might also be helpful it you indicate there that you can’t browse it for security reasons, but the artifacts are available for public download. Most usually maven developers know if they can’t get their dependencies fixed they can always browse the repo and figure it out. In this case you can’t and I think it would be beneficial to provide a warning.

    Thanks again.

    James Lorenzen - April 9th, 2008 at 6:16 am
  4. Thanks for the suggestions James! I’ll will certainly update the documentation to make this clearer for others in the future.

    rcoffin - April 9th, 2008 at 6:23 am
  5. I forgot to escape the xml in my previous comment:

    <pluginRepositories>
    <pluginRepository>
    <id>easyb</id>
    <url>http://www.easyb.org/repo/</url>
    </pluginRepository>
    </pluginRepositories>

    James Lorenzen - April 9th, 2008 at 6:48 am

Leave a Reply