concept name in category griffon

appears as: names, name, names, name, The name
Griffon in Action

This is an excerpt from Manning's book Griffon in Action.

Next, you’ll spend some time working with the menu items. You’ve hard-coded the names of the actions into the view of your application. Griffon lets you separate your action code from the rest of your application. Defining an action also leads to code reuse, because many Swing components can use the action definition to configure themselves—for example, their label and icon—and also to handle the job they’re supposed to do.

It’s true: the name of the method is a Groovy string. In case you didn’t know it, the JVM supports method names with characters that the Java language doesn’t allow, like spaces, but that the Groovy compiler can allow. Therefore, Spock’s AST transform moves test method names into annotations and replaces them with safe names in the AST. The Spock runtime later undoes the effect, for example, by applying the reverse replacement in stack traces. Another feature that might have caught your eye is the usage of a block label and the fact that the expectation (an assertion) doesn’t require the assert keyword.

Figure 9.4. HTML report of DictionaryServiceSpec. Pay close attention to the name of the third method. Notice that the variable placeholders have been replaced with values from the data table.
1 scenario executed successfully. (0 behaviors were ignored)
  Story: dictionary service
    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'

Isn’t that a time saver in terms of setup and configuration? We’d like to think so. But we’re not done yet. The next section covers running specific tests by name.