文件名称:Spock Up and Running
文件大小:4.7MB
文件格式:PDF
更新时间:2021-06-26 15:30:31
Spock Groovy
Welcome to Spock: Up and Running. I’m excited and privileged to be your guide as lbt tht itithithtttithJVitlWltSpkUp d RigI’itd d piilgd tbygid you learn about the most innovative thing to happen to testing on the Java Virtual Mhi(JVM) ithfit lf JUitylbt tht itithig t Machine (JVM) since the first release of JUnit.From the time I first began writing unit tests (badly), I’ve always been interested in kittllttddbld tihtfd iblIFthtiI fit bgitig it tt(bdly)I’lybittd i making my tests as well-structured, readable, and straightforward as possible. I bd thfJUit 3 tJUit 4 ith Ht d hitdkig y ttllttddbld tightfd piblI embraced the move from JUnit 3 to JUnit 4 with Hamcrest and have experimented ith thifFitNtCbTtNG tJid SlTt tbd thfJUit 3 tJUit 4 ith Ht d hpitd with everything from FitNesse to Cucumber, TestNG to Jasmine, and ScalaTest to SkI d’t thik thihdthit ttitltht Sk hith ythig fFitNtCbTtNG tJid SlTt Spek. I don’t think anything has made the impact on my testing style that Spock has.For me, Spock is absolutely the “killer app” of the Groovy ecosystem. Sure, GPars dGdld bildfXML hlld GildthFSpk ibltly th“killpp” f thGy ytSGP made concurrency easy, Gradle saved builds from XML hell, and Grails made throw‐ itththbif b thk f itththhBt thdy yGdld bildfXML hlld Gildth ing together the basics of a web app the work of minutes rather than hours. But noth‐ ilitG’ditltbild thitht ilkthiig tgththbif b pp thk f itththhBt th ing exploits Groovy’s dynamic style to build something that genuinely makes things id bttfllSkig plitGy’dyityltb easier and better as successfully as Spock.And Spock makes things better not just for the 80 percent of cases, but across the bdI ht ithld fJUitit’itht dbt f thtAd Spk kthigbttt jt fth80 pt f bt th board. I have every respect in the world for JUnit—it’s without doubt one of the most itt itiithhitf thJVMbt I ’t thik f I bdI hy pt ithld fJUitit’itht dbt f tht important innovations in the history of the JVM—but I can’t think of any case I can tklbttith JUit thI ith Skiptt itiithhity f thJV tackle better with JUnit than I can with Spock.I hope you find Spock as logical, fascinating, and useful as I do.