Move tests from 'samples' to 'test-samples'
This commit is contained in:
@@ -1,4 +0,0 @@
|
||||
class Book {
|
||||
String author
|
||||
String title
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
class Book {
|
||||
String author
|
||||
String title
|
||||
}
|
||||
|
||||
class BookTests {
|
||||
@Test
|
||||
void testBooks() {
|
||||
Book book = new Book(author: "Tom Clancy", title: "Threat Vector")
|
||||
assertEquals("Tom Clancy", book.author)
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
class FailingJUnitTests {
|
||||
@Test
|
||||
void passingTest() {
|
||||
assertTrue(true)
|
||||
}
|
||||
|
||||
@Test
|
||||
void failureByAssertion() {
|
||||
assertTrue(false)
|
||||
}
|
||||
|
||||
@Test
|
||||
void failureByException() {
|
||||
throw new RuntimeException("This should also be handled")
|
||||
}
|
||||
}
|
||||
|
||||
class FailingSpockTest extends Specification {
|
||||
def "this should pass"() {
|
||||
expect:
|
||||
name.size() == length
|
||||
|
||||
where:
|
||||
name | length
|
||||
"Spock" | 5
|
||||
}
|
||||
|
||||
def "this should fail on purpose as well"() {
|
||||
when:
|
||||
String text = "Greetings"
|
||||
|
||||
then:
|
||||
//throw new RuntimeException("This should fail!")
|
||||
true == false
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
class HelloSpock extends Specification {
|
||||
def "length of Spock's and his friends' names"() {
|
||||
expect:
|
||||
name.size() == length
|
||||
|
||||
where:
|
||||
name | length
|
||||
"Spock" | 5
|
||||
"Kirk" | 4
|
||||
"Scotty" | 6
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
class BookTests {
|
||||
@Test
|
||||
void testBooks() {
|
||||
Book book = new Book(author: "Tom Clancy", title: "Threat Vector")
|
||||
assertEquals("Tom Clancy", book.author)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user