Skip to content

Commit

Permalink
Fix callouts in docs
Browse files Browse the repository at this point in the history
There was one superfluous callout and all callouts were broken to the next line
  • Loading branch information
Vampire authored Mar 20, 2024
1 parent 1b4349e commit 9f5220c
Showing 1 changed file with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,34 +90,35 @@ class ExtensionStoreSpec extends EmbeddedSpecification {
}
// tag::example-extension[]
class ExceptionCounterGlobalExtension implements IGlobalExtension {
private static final Namespace EXAMPLE_NS = Namespace.create(ExceptionCounterGlobalExtension) // <1>
private static final Namespace EXAMPLE_NS = // <1>
Namespace.create(ExceptionCounterGlobalExtension)
private static final String ACCUMULATOR = "accumulator"
private static final IMethodInterceptor INTERCEPTOR = {
try {
it.proceed()
} catch (Exception e) {
it.getStore(EXAMPLE_NS) // <6>
.get(ACCUMULATOR, ConcurrentHashMap) // <7>
.computeIfAbsent(e.class.name, { __ -> new AtomicInteger() }) // <8>
it.getStore(EXAMPLE_NS) // <6>
.get(ACCUMULATOR, ConcurrentHashMap) // <7>
.computeIfAbsent(e.class.name, { __ -> new AtomicInteger() }) // <8>
.incrementAndGet()
throw e
}
}

@Override
void visitSpec(SpecInfo spec) {
spec.allFeatures.featureMethod*.addInterceptor(INTERCEPTOR) // <2>
spec.allFeatures.featureMethod*.addInterceptor(INTERCEPTOR) // <2>
}

@Override
void executionStart(ISpockExecution spockExecution) { // <3>
spockExecution.getStore(EXAMPLE_NS) // <4>
.put(ACCUMULATOR, new ConcurrentHashMap()) // <5>
void executionStart(ISpockExecution spockExecution) { // <3>
spockExecution.getStore(EXAMPLE_NS) // <4>
.put(ACCUMULATOR, new ConcurrentHashMap()) // <5>
}

@Override
void executionStop(ISpockExecution spockExecution) { // <9>
def results = spockExecution.getStore(EXAMPLE_NS) // <10>
void executionStop(ISpockExecution spockExecution) { // <9>
def results = spockExecution.getStore(EXAMPLE_NS)
.get(ACCUMULATOR, ConcurrentHashMap)

if (!results.isEmpty()) {
Expand Down

0 comments on commit 9f5220c

Please sign in to comment.