Fork me on GitHub

18 Aug 2011

Data-driven variation with Spock

Spock’s where: block is commonly used with a data table but can also be driven by any Iterable data. It’s worth bearing in mind that the data driving the where: block doesn’t have to be hardcoded, it can be dynamic. For example, today we implemented a spec to ensure that every table in our database schema has a primary key (because it’s required by HA-JDBC and not automatically added by GORM on join tables). In this spec the where: block is driven by the list of table names read from the database metadata.

Something like this could be done with JUnit, of course. A test could iterate over the table names and assert that each has a primary key. However, such a test would fail fast whereas with the power of Spock’s @Unroll annotation the spec creates a separate test result for each database table and will run each individually regardless of whether any others pass or fail. The command line output from this spec will be enough to tell you which tables do not have primary keys as @Unroll puts the table name right in the test name.

The other great thing about this spec is that it doesn’t require maintenance; as we add more domain classes to our app the spec will automatically check the associated tables.

11 comments:

qinbincai123 said...

We,of that time,are no longer the same hike81ai I no longer love her,
that's certain,but how I loved her.
Cheap Snapback Hats
Cheap New Era Hats
Wholesale New Era Hats
Wholesale 59fifty Hats
Monster Energy Hats

Bella Tran said...

I hope you post again soon.
descargar mobogenie gratis | baixar facebook gratis | mobogenie baixar | facebook descargar | facebook descargar gratis | mobogenie descargar | whatsapp descargar gratis and gratis whatsapp |
descargar mobogenie

Online Friv said...

You need to kill time, you need entertainment. Refer to our website. hope you get the most comfort.
Thanks you for sharing!
Friv 4

Games Friv said...

Play the Best Free Games! We've picked out the racing games, cooking games, candy crush, games shooting, fashion games, ...
Thanks for sharing !
Kizi 200
Friv 1
Y88
Y9

huong duong said...

I learned a lot of useful things from this article Baixar Musicas , Baixar Musicas , Baixar Musicas , Baixar Musicas , Baixar Musicas, Baixar Musicas , Baixar Musicas , Baixar Musicas , Baixar Musicas , Baixar Musicas

buyket said...


عزيزي عميل مدينه الخرج نوفر لك افضل خدمات التنظيف المختلفه من منازل ومجالس وغيرهما وايضا نوفر لك مكافحة الحشرات بالخرج لنوفر لك افضل سبل الحصول علي منزل نظيف وخالي من الحشرات وذلك بافضل الفنيين وامهرهم
شركة مكافحة حشرات بالخرج
شركة تنظيف منازل بالخرج
شركة تنظيف بالخرج
شركة تنظيف فلل بالخرج
شركة تنظيف مجالس بالخرج
نستخدم افضل المكينات المخصصه في تنظيف الموكيت والسجاد الخاص بالمساجد والتي تعمل عن طريق تنظيف موكيت المساجد بالمنظفات الحديثه لكي نصل الي اعلي مستوي من التنظيف

كما ان جودة التنظيف الخاص بتنظيف الموكيت تعتمد علي نوعيته مع استخدام المكينات الحديثه وبالاضافه الي الايدي العامله المدربه حديثا

شركة تنظيف مساجد بالرياض


Hala Qayani said...

Drama as the natural property of the city in this application refers. In writing, the term isolation used as an object is used to refer to a story (source) touching parts through a row in an extension representing periodic production. Generally, the "serial" issued under the same heading in a step connected to the library and the scientific content data in any medium, "usually numbered source separate pieces and continuous or unexpected break show the inevitable result."
The term is used for television, radio or a uniform framework for continuous development and characters, and is divided into several scenes. In the Philippines, daily cleaning is the serial source structure of long music programs. Small TV arrangements came regularly in a frame of quality.
Starting in the mid-90s, musical arrangements and cleanliness appear as source the stories began to broadcast in prime time (like Dallas, Dynasty). In the 2017, it shows source which use a structure like the Soprano series, and now have a wide range of programs in a sequential frame

قمة الدقة للخدمات said...


شركة كشف تسربات المياه بالدمام
شركة تسليك مجارى بالخبر

ali gamal said...


شركة تنظيف سجاد وموكيت بالدمام
ان شركة النسور شركة متخصصة لعمليات نقل العفش بجميع انحاء المملكة العربية وبالمنطقة الشرقية خاصة مع ضمان علي اداء العمل خصومات وعروض رائعه يمكنك الاستمتاع بالخدمات عن طريق زيارة الرابط التالي شركة نقل اثاث بالاحساء

شركة عزل اسطح بالاحساء

marwa mohamed said...


شركة تنظيف منازل بالخرج
تختص شركتنا بكافة أعمال التنظيف المنزلية ,والتي قد تتطلب مجهودا بدنيا شاقا قد يعجز أفراد الأسرة عن إنجازه وبشكل احترافي
https://www.khpeer.com/%D8%B4%D8%B1%D9%83%D8%A9-%D8%AA%D9%86%D8%B8%D9%8A%D9%81-%D9%85%D9%86%D8%A7%D8%B2%D9%84-%D8%A8%D8%A7%D9%84%D8%AE%D8%B1%D8%AC/

شركة تنظيف مجالس بالخرج
عمالة مدربة و على أعلى مستوى من الاحترافية يضمن لك الحصول على أفضل النتائج لإرضائك فرضاؤكم هو هدفنا
https://www.khpeer.com/%D8%B4%D8%B1%D9%83%D8%A9-%D8%AA%D9%86%D8%B8%D9%8A%D9%81-%D9%85%D8%AC%D8%A7%D9%84%D8%B3-%D8%A8%D8%A7%D9%84%D8%AE%D8%B1%D8%AC/

شركة تنظيف موكيت بالخرج
تقدم الشركة خدمات تنظيف وبأفضل مستوى للموكيت و السجاد و بأجود أنواع العمالة المدربة وبأسعار تناسب جميع العملاء
https://www.khpeer.com/%D8%B4%D8%B1%D9%83%D8%A9-%D8%AA%D9%86%D8%B8%D9%8A%D9%81-%D9%85%D9%88%D9%83%D9%8A%D8%AA-%D8%A8%D8%A7%D9%84%D8%AE%D8%B1%D8%AC/

zeeba Martin said...

Akshaya Lottery Result - Kerala Lottery Result. Akshaya Lottery Result, AKSHAYA AK 319 Lottery Result 15.11.2018, Kerala Lottery Result Today, Akshaya Lottery Result 15-11-2018, 15.11.2018 Kerala. Kerala Lottery Result Today | Nirmal Lottery NR 44 Result 17.11.2018. Kerala Lottery Results, Live Results, Karunya/Nirmal/Akshaya/Bhagyanidhi/win/Pournami comes about hashtag on Twitter
See Tweets about keralalotteryresult on Twitter. See what individuals are stating and join the discussion. Kerala Lottery Results | LinkedIn. Kerala lottery result today official government result on Keralalotteries today kerala comes about destinations are keralalotteries in Read more and .com. Kerala periodical to see kerala. Kerala Lottery Result Today LIVE: Akshaya Lottery AK 319. Discover Kerala Lottery Result Today From com every day inhabit 3.30 PM. Versatile well disposed of Read more and comes about on the web.
Todays Lottery Result: Nirmal Biweekly first | Bhagyanidhi 258 We are a special site of kerala lottery, We are distributing Up-to-date Kerala Lottery Results and Read more here We are likewise giving other interesting administrations, for example, Kerala State Lotteries - Wikipedia and Read more
Kerala State Lotteries is a lottery program keep running by the Government of Kerala. Built up in ... week after week and few Bumper Lotteries as well. At Read more we have recorded all the diverse sorts of Kerala Lottery comes about with their particular discharge date. Founded‎: ‎1967. Headquarters‎: ‎Thiruvananthapuram, Kerala, India
kerala lottery comes about: Kerala lottery Onam Bumper 2018 outcome: Sep 22, 2018 - Onam Bumper 2018 Results: The Kerala state lottery division on Wednesday reported the Read more Onam Special 'Thiruvonam. Kerala Lottery Results Today Online: Kerala State Lotteries Live. www Kerala Lottery Results live Today online tickets 2018 akshaya, karunya Win-Win, Sthree Shakthi, Karunya Plus. Nirmal, Pournami Weekly Bumper Lotteries. kerala lottery result today Karunya Lottery KR-318 Results 4-11-2018. Video for kerala lottery result. 1:11. Nov 4, 2018 - Uploaded by WEBCASTKERALA