Spock

Jak pisać testy z dobrą fabułą

Dlaczego spock?

  • czytelny i zwięzły
  • niski próg wejścia
  • wygodny

class JugMeeting extends Specification {

    def jugMeeting = new Meeting(["Spock", "Gerrit"])
    def attendee = new Person("John")

    def "JUG meeting on 23.07.2014 should be a success"() {
        given:
        attendee.setKnownFrameworks(["JUnit", "Mockito"])
        attendee.setMoodPercent(20)

        when:
        attendee.attend(jugMeeting)

        then:
        attendee.moodPercent > 80
        attendee.knowFrameworks.contains("Spock")
        attendee.isAwake
}
}

spock

By Magda Stożek

spock

  • 36
Loading comments...

More from Magda Stożek