@@ -44,38 +44,32 @@ class OrderExtensionSpec extends EmbeddedSpecification {
44
44
compiler. addClassMemberImport(OrderExtensionSpec )
45
45
compiler. addClassImport(Order )
46
46
specs = compiler. compileWithImports("""
47
- class FirstSpec extends Specification {
47
+ abstract class BaseSpec extends Specification {
48
48
@Shared execution = new SpecExecution(spec: this.class.simpleName)
49
49
def setup() { execution.features << specificationContext.currentFeature.name }
50
50
def cleanupSpec() { executionsTL.get() << execution }
51
+ }
52
+
53
+ class FirstSpec extends BaseSpec {
51
54
def one() { expect: true }
52
55
def two() { expect: true }
53
56
def three() { expect: true }
54
57
}
55
58
56
59
@Order(-1)
57
- class SecondSpec extends Specification {
58
- @Shared execution = new SpecExecution(spec: this.class.simpleName)
59
- def setup() { execution.features << specificationContext.currentFeature.name }
60
- def cleanupSpec() { executionsTL.get() << execution }
60
+ class SecondSpec extends BaseSpec {
61
61
def foo() { expect: true }
62
62
@Order(99) def bar() { expect: true }
63
63
@Order(-5) def zot() { expect: true }
64
64
}
65
65
66
- class ThirdSpec extends Specification {
67
- @Shared execution = new SpecExecution(spec: this.class.simpleName)
68
- def setup() { execution.features << specificationContext.currentFeature.name }
69
- def cleanupSpec() { executionsTL.get() << execution }
66
+ class ThirdSpec extends BaseSpec {
70
67
def "some feature"() { expect: true }
71
68
@Order(1) def "another feature"() { expect: true }
72
69
def "one more feature"() { expect: true }
73
70
}
74
71
75
- class FourthSpec extends Specification {
76
- @Shared execution = new SpecExecution(spec: this.class.simpleName)
77
- def setup() { execution.features << specificationContext.currentFeature.name }
78
- def cleanupSpec() { executionsTL.get() << execution }
72
+ class FourthSpec extends BaseSpec {
79
73
def 'feature X'() { expect: true }
80
74
def 'feature M'() { expect: true }
81
75
@Order(-1) def 'feature D'() { expect: true }
0 commit comments