Skip to content

Commit

Permalink
README examples of extension methods usage.
Browse files Browse the repository at this point in the history
  • Loading branch information
renatoathaydes committed Dec 13, 2017
1 parent 663a50c commit 3bb718e
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,22 @@ If you want to add information to your Spock-reports programmatically, since ver
* `void reportInfo( arg )` - add data to the feature's section.

These methods are added as
[Groovy extensions](http://docs.groovy-lang.org/docs/next/html/documentation/core-metaprogramming.html#module-descriptor)),
[Groovy extensions](http://docs.groovy-lang.org/docs/next/html/documentation/core-metaprogramming.html#module-descriptor),
so your IDE should be able to show them in auto-completion!

For example, you could do something like this within your `Specification`:

```groovy
def setupSpec() {
reportHeader "<h2>Browser: ${driver.browser.name}</h2>"
}
def "My feature"() {
expect:
reportInfo "Some information I want to show in the report"
}
```

### If you are using Maven

Add ``spock-reports`` to your ``<dependencies>``:
Expand Down

0 comments on commit 3bb718e

Please sign in to comment.