You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PendingFeatureSuccessfulErrorassertionError = newPendingFeatureSuccessfulError("Feature is marked with " + annotationUsed + " but passes unexpectedly");
Copy file name to clipboardExpand all lines: spock-core/src/main/java/org/spockframework/runtime/extension/builtin/PendingFeatureIterationInterceptor.java
Copy file name to clipboardExpand all lines: spock-specs/src/test/groovy/org/spockframework/smoke/extension/PendingFeatureIfExtensionSpec.groovy
+94Lines changed: 94 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -37,6 +37,100 @@ def bar() {
37
37
e.message =="Feature is marked with @PendingFeatureIf but passes unexpectedly"
38
38
}
39
39
40
+
def"@PendingFeatureIf marks passing feature as failed if the conditional expression returns true even if @PendingFeature is applied first"() {
41
+
when:
42
+
runner.runSpecBody """
43
+
@PendingFeature
44
+
@PendingFeatureIf({true})
45
+
def bar() {
46
+
expect: true
47
+
}
48
+
"""
49
+
50
+
then:
51
+
AssertionError e = thrown()
52
+
e.message =="Feature is marked with @PendingFeatureIf but passes unexpectedly"
53
+
}
54
+
55
+
def"@PendingFeatureIf marks passing parameterized feature as failed if the conditional expression returns true even if @PendingFeature is applied first"() {
56
+
when:
57
+
runner.runSpecBody """
58
+
@PendingFeature
59
+
@PendingFeatureIf({true})
60
+
def bar() {
61
+
expect: true
62
+
where: a = 1
63
+
}
64
+
"""
65
+
66
+
then:
67
+
AssertionError e = thrown()
68
+
e.message =="Feature is marked with @PendingFeatureIf but passes unexpectedly"
69
+
}
70
+
71
+
def"@PendingFeatureIf marks passing feature as failed if the data variable accessing conditional expression returns true even if @PendingFeature is applied first"() {
72
+
when:
73
+
runner.runSpecBody """
74
+
@PendingFeature
75
+
@PendingFeatureIf({a == 1})
76
+
def bar() {
77
+
expect: true
78
+
where: a = 1
79
+
}
80
+
"""
81
+
82
+
then:
83
+
AssertionError e = thrown()
84
+
e.message =="Feature is marked with @PendingFeatureIf but passes unexpectedly"
85
+
}
86
+
87
+
def"@PendingFeatureIf marks passing feature as failed if the conditional expression returns true even if @PendingFeature is applied after it"() {
88
+
when:
89
+
runner.runSpecBody """
90
+
@PendingFeatureIf({true})
91
+
@PendingFeature
92
+
def bar() {
93
+
expect: true
94
+
}
95
+
"""
96
+
97
+
then:
98
+
AssertionError e = thrown()
99
+
e.message =="Feature is marked with @PendingFeature but passes unexpectedly"
100
+
}
101
+
102
+
def"@PendingFeatureIf marks passing parameterized feature as failed if the conditional expression returns true even if @PendingFeature is applied after it"() {
103
+
when:
104
+
runner.runSpecBody """
105
+
@PendingFeatureIf({true})
106
+
@PendingFeature
107
+
def bar() {
108
+
expect: true
109
+
where: a = 1
110
+
}
111
+
"""
112
+
113
+
then:
114
+
AssertionError e = thrown()
115
+
e.message =="Feature is marked with @PendingFeature but passes unexpectedly"
116
+
}
117
+
118
+
def"@PendingFeatureIf marks passing feature as failed if the data variable accessing conditional expression returns true even if @PendingFeature is applied after it"() {
119
+
when:
120
+
runner.runSpecBody """
121
+
@PendingFeatureIf({a == 1})
122
+
@PendingFeature
123
+
def bar() {
124
+
expect: true
125
+
where: a = 1
126
+
}
127
+
"""
128
+
129
+
then:
130
+
AssertionError e = thrown()
131
+
e.message =="Feature is marked with @PendingFeatureIf but passes unexpectedly"
132
+
}
133
+
40
134
def"@PendingFeatureIf marks failing feature as failed if the conditional expression returns false"() {
0 commit comments