-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #84 from Vampire/spock-tests
Add Spock tests
- Loading branch information
Showing
18 changed files
with
637 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/test/groovy/org/pitest/junit5/repository/TestSpec.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Copyright 2023 Björn Kautler | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.pitest.junit5.repository | ||
|
||
import spock.lang.Specification | ||
|
||
class TestSpec extends Specification { | ||
def test() { | ||
expect: | ||
true | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
src/test/groovy/org/pitest/junit5/repository/TestSpecWithAbortingFeature.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright 2023 Björn Kautler | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.pitest.junit5.repository | ||
|
||
import org.opentest4j.TestAbortedException | ||
import spock.lang.IgnoreIf | ||
import spock.lang.Specification | ||
|
||
class TestSpecWithAbortingFeature extends Specification { | ||
@IgnoreIf({ data.ignore }) | ||
def test() { | ||
expect: | ||
false | ||
|
||
where: | ||
ignore = true | ||
} | ||
|
||
def test2() { | ||
expect: | ||
throw new TestAbortedException() | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
src/test/groovy/org/pitest/junit5/repository/TestSpecWithCleanupSpec.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright 2023 Björn Kautler | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.pitest.junit5.repository | ||
|
||
import spock.lang.Specification | ||
|
||
class TestSpecWithCleanupSpec extends Specification { | ||
def cleanupSpec() { | ||
} | ||
|
||
def aTest() { | ||
expect: | ||
true | ||
} | ||
|
||
def anotherTest() { | ||
expect: | ||
true | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
src/test/groovy/org/pitest/junit5/repository/TestSpecWithDataDrivenFeature.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright 2023 Björn Kautler | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.pitest.junit5.repository | ||
|
||
import spock.lang.Specification | ||
|
||
class TestSpecWithDataDrivenFeature extends Specification { | ||
def test() { | ||
expect: | ||
true | ||
|
||
where: | ||
i = 1 | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
src/test/groovy/org/pitest/junit5/repository/TestSpecWithFailingCleanupSpec.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright 2023 Björn Kautler | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.pitest.junit5.repository | ||
|
||
import spock.lang.Specification | ||
|
||
class TestSpecWithFailingCleanupSpec extends Specification { | ||
def cleanupSpec() { | ||
assert false | ||
} | ||
|
||
def aTest() { | ||
expect: | ||
true | ||
} | ||
|
||
def anotherTest() { | ||
expect: | ||
true | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/test/groovy/org/pitest/junit5/repository/TestSpecWithFailingFeature.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Copyright 2023 Björn Kautler | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.pitest.junit5.repository | ||
|
||
import spock.lang.Specification | ||
|
||
class TestSpecWithFailingFeature extends Specification { | ||
def test() { | ||
expect: | ||
false | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
src/test/groovy/org/pitest/junit5/repository/TestSpecWithFailingSetupSpec.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright 2023 Björn Kautler | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.pitest.junit5.repository | ||
|
||
import spock.lang.Specification | ||
|
||
class TestSpecWithFailingSetupSpec extends Specification { | ||
def setupSpec() { | ||
assert false | ||
} | ||
|
||
def aTest() { | ||
expect: | ||
true | ||
} | ||
|
||
def anotherTest() { | ||
expect: | ||
true | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
src/test/groovy/org/pitest/junit5/repository/TestSpecWithIncludedFeature.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright 2023 Björn Kautler | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.pitest.junit5.repository | ||
|
||
import spock.lang.Specification | ||
|
||
class TestSpecWithIncludedFeature extends Specification { | ||
def test() { | ||
expect: | ||
true | ||
} | ||
|
||
def included() { | ||
expect: | ||
true | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/test/groovy/org/pitest/junit5/repository/TestSpecWithInheritedFeature.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* Copyright 2023 Björn Kautler | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.pitest.junit5.repository | ||
|
||
class TestSpecWithInheritedFeature extends TestSpec { | ||
} |
Oops, something went wrong.