diff --git a/src/main/java/com/greghaskins/spectrum/Spectrum.java b/src/main/java/com/greghaskins/spectrum/Spectrum.java index 45a9542..d79dfcf 100644 --- a/src/main/java/com/greghaskins/spectrum/Spectrum.java +++ b/src/main/java/com/greghaskins/spectrum/Spectrum.java @@ -146,7 +146,7 @@ public void run(final RunNotifier notifier) { this.rootSuite.run(notifier); } - private static void beginDefintion(final Suite suite, final Block definitionBlock) { + synchronized private static void beginDefintion(final Suite suite, final Block definitionBlock) { suiteStack.push(suite); try { definitionBlock.run(); @@ -156,7 +156,7 @@ private static void beginDefintion(final Suite suite, final Block definitionBloc suiteStack.pop(); } - private static Suite getCurrentSuite() { + synchronized private static Suite getCurrentSuite() { return suiteStack.peek(); }