public
Description: This plugin will enable the use of Easyb to write Behavior driven Tests in a grails application.
Homepage: http://www.urubatan.info/tag/easyb-test/
Clone URL: git://github.com/urubatan/easybtest.git
urubatan (author)
Tue Apr 22 09:00:08 -0700 2008
commit  8bea5c79b53d6b29a2ee513f08b41118a44997df
tree    10b72913a53acaeb9bd167ad78dc61b210366936
parent  55d1e23d63d5e54f84f09142fc37a166cad67684
easybtest / EasybtestGrailsPlugin.groovy
100755 54 lines (45 sloc) 1.812 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
class EasybtestGrailsPlugin {
  def version = 0.3;
  def author = "Rodrigo Uruatan Ferreira Jardim";
  def authorEmail = "blog@urubatan.com.br";
  def title = "This plugin enables the testing of the application using the BDD easyb library";
  def dependsOn = [:];
  def description = '''\
    This plugin enables the use of Behavior Driven Development to test your Grails Application,
    The library behind this is easyb, easyb is a BDD library written in groovy.
    For example, you can test your app like this:
 
    given "an invalid zip code", {
      invalidzipcode = "221o1"
    }
    and "given the zipcodevalidator is initialized", {
      zipvalidate = new ZipCodeValidator()
    }
    when "validate is invoked with the invalid zip code", {
      value = zipvalidate.validate(invalidzipcode)
    }
    then "the validator instance should return false", {
      value.shouldBe false
    }
    '''
  def documentation = "http://www.urubatan.info/tag/easyb-test/"
 
  def doWithSpring = {
  // TODO Implement runtime spring config (optional)
  }
 
  def doWithApplicationContext = { applicationContext ->
  // TODO Implement post initialization spring config (optional)
  }
 
  def doWithWebDescriptor = { xml ->
  // TODO Implement additions to web.xml (optional)
  }
 
  def doWithDynamicMethods = { ctx ->
    // TODO Implement registering dynamic methods to classes (optional)
  }
 
  def onChange = { event ->
  // TODO Implement code that is executed when this class plugin class is changed
  // the event contains: event.application and event.applicationContext objects
  }
 
  def onApplicationChange = { event ->
  // TODO Implement code that is executed when any class in a GrailsApplication changes
  // the event contain: event.source, event.application and event.applicationContext objects
  }
}