Skip to: Site menu | Main content

A Grails-like Rich Internet Framework

Easyb Plugin Print

Description

Brings Behavior Driven Development to your Griffon application via Easyb. This is a port of the Grails Easyb plugin (version 0.8) made by Rodrigo Urubatan.

Installation

The current version of griffon-easyb-plugin is 0.1.1

To install just issue the following command

griffon install-plugin easyb

Usage

Easyb plugin provides two new scripts:

  • create-easyb-story: this script will create a new Easyb story based on a common template, the resulting file will be place at $basedir/test/easyb.
  • run-easyb: this script will run all Easyb stories and specifications (if any) and output a report at $basedir/test/easyb-reports. Any groovy files that match the following naming conventions will be run as either stories or specifications
    • *Story.groovy
    • *.story
    • *Specificattion.groovy
    • *.specification

The following are the contents of the base scenario

scenario "Hello Groovy", {
   given "A prefix string 'Hello '", {
      prefix = "Hello "
   }

   and "A name is chosen, such as 'Groovy'", {
      name = "Groovy"
   }

   when "Both the prefix and name are concatenated into a greeting", {
      greeting = prefix + name
   }

   then "The greeting should be equal to 'Hello Groovy'", {
      greeting.shouldBe "Hello Groovy"
   }
}

Which produces the following output ($basedir/test/easyb-reports/stories.txt) when run

 1 scenario (including 0 pending) executed successfully

  Story: word finder

    scenario Hello Groovy
      given A prefix string 'Hello '
      given A name is chosen, such as 'Groovy'
      when Both the prefix and name are concatenated into a greeting
      then The greeting should be equal to 'Hello Groovy'

Easyb plugin can provide cobertura reports if the code-coverage plugin is installed, just make sure to append a -cobertura flag to the command line when running your Easyb stories

griffon run-easyb -cobertura

History

Version Date Notes
0.1.1 03-09-09 Bumped version to be compatible with Griffon 0.1.0
0.1