{"id":6784,"date":"2012-08-31T00:35:56","date_gmt":"2012-08-30T19:05:56","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=6784"},"modified":"2012-08-31T00:46:41","modified_gmt":"2012-08-30T19:16:41","slug":"cool-spock-ignoreignorerest-annotations","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/cool-spock-ignoreignorerest-annotations\/","title":{"rendered":"Cool Spock Ignore\/IgnoreRest annotations"},"content":{"rendered":"<p>While writing a test case, we are generally interested in executing only the one we are working on. With JUnit test case in grails we could say &#8220;grails test-app  &lt;ClassName&gt;.&lt;currentTestCase&gt;&#8221;.\u00a0 However it doesn&#8217;t work with spock specification&#8217;s.<br \/>\n<a href=\"http:\/\/code.google.com\/p\/spock\/wiki\/SpockBasics\">Spock framework<\/a> provides multiple cool annotations,\u00a0 following two annotations can be used to speed up writing\/executing test case in question :<\/p>\n<ol>\n<li><strong>@IgnoreRest <\/strong>: Ignores all feature methods not carrying this annotation. Useful for quickly running just a single method.<\/li>\n<li><strong>@Ignore<\/strong> : Ignores a feature method.<\/li>\n<\/ol>\n<p>So while writing specification I prefer @IgnoreRest instead of giving even the class name to be tested and remove it later once I am done with the specification. Similarly If there is a specification that takes good time to execute and doesn&#8217;t need to be tested right now, we can annotate it with @Ignore, to save some time.  <\/p>\n<p>~~Amit Jain~~<\/p>\n<p>amit@intelligrape.com<\/p>\n","protected":false},"excerpt":{"rendered":"<p>While writing a test case, we are generally interested in executing only the one we are working on. With JUnit test case in grails we could say &#8220;grails test-app &lt;ClassName&gt;.&lt;currentTestCase&gt;&#8221;.\u00a0 However it doesn&#8217;t work with spock specification&#8217;s. Spock framework provides multiple cool annotations,\u00a0 following two annotations can be used to speed up writing\/executing test case [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":7},"categories":[7],"tags":[4840,904,903,902,490],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/6784"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=6784"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/6784\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=6784"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=6784"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=6784"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}