spock Questions

1

Solved

I'm a java developer finding myself modifying a groovy test, so I apologize if I'm pretty ignorant about basic groovy concepts and terminology (I think I should be saying closure instead of method ...
Ramsden asked 6/5, 2016 at 15:51

2

In a Spock Specification any line in expect: or then: block is evaluated and asserted as boolean, unless it has signature with return type void. I've noticed that there is something odd going on f...
Hydra asked 11/4, 2016 at 12:55

1

Solved

What's the difference between: @Shared MyObject myObject = new MyObject() and MyObject myObject def setupSpec() { myObject = new MyObjec() } Why should I use the @Shared annotation in the s...
Besmirch asked 5/4, 2016 at 11:28

2

Solved

I'm working with Spock tests atm and I wonder if anything like this is even possbile. My approaches don't work and I wonder if anyone of you had similiar intentions and found a way. I want to call...
Cervix asked 14/1, 2014 at 12:39

4

Solved

Given the following, how do I mock processMessage() using Spock, so that I can check that processBulkMessage() calls processMessage() n times, where n is the number of messages within a BulkMessage...
Namnama asked 12/12, 2014 at 14:47

2

How do scalatest and spock differ? what is the added-value of each ? Which is more agile for Behavior Driven Development (BDD)? Please could you share some thoughts on the matter ? I want to start...
Pluralize asked 19/4, 2013 at 14:53

2

Solved

I need to get the dependencies injected in my domain objects in my tests. This tests are placed in the test/integration directory and extends from spock.lang.Specification. How can I achieve this...
Marquetry asked 13/8, 2012 at 4:35

2

Solved

I'm trying to write some Spock tests with Groovy to test some Java code (specifically a servlet Filter). I have some private static and private static final variables that I would like to mock, but...
Ajay asked 18/12, 2014 at 17:43

1

Solved

I'm trying to run grails geb/spock tests on jenkins. I install Xvfb Plugin https://wiki.jenkins-ci.org/display/JENKINS/Xvfb+Plugin. Jenkins configurations: Project configuration: Exception: ...
Frill asked 6/8, 2015 at 13:32

1

Solved

There | are | so many | Spock | spec examples of how to use its labels, such as: // when -> then label combo def "test something"() { when: // blah then: // blah blah } Such label combin...
Manes asked 10/10, 2015 at 0:59

3

Solved

FitNesse has a wiki-style documentation feature. It provided both the code and the doc's for these specification tests. Is there a way in Spock (with plugin? / out of the box?) to generate any type...
Musset asked 3/8, 2011 at 21:7

2

I've tried to make an Spock test for a class, where i need to check that it sends a message to actor (say statActor). I know that Akka have special library for integration test, but seems that it's...
Piquant asked 3/6, 2012 at 8:41

1

Solved

I just noticed that Spock does not assert the conditions if I add an if clause in the expect block as in def myTest() { given: a = true expect: if ( a ) { 1 == 2 } else { 1 == 1 } } T...
Hahn asked 22/8, 2015 at 15:16

1

Solved

I am brand new to Spock and perused their online docs. I have a test case where I need to verify that my fixture's interaction with a non-mock collaborator does not produce an exception: class Fiz...
Mideast asked 20/8, 2015 at 19:41

1

Solved

I am working on grails/groovy project and while reading their test documentation came across this line of code 1 * myService.prova() >> { true } I am unable to understand what does 1 * mea...
Grannias asked 4/8, 2015 at 6:17

3

Solved

I'm using the Groovy RESTClient class to do write some (spock) Acceptance tests for Java WebServices I've been authoring. One frustration I've had is in testing the responses... 200 Status's are ...
Predicative asked 23/10, 2013 at 16:4

1

Solved

I have been using spock for a while to unit test my java project, and have ran into a problem. I have a utility method to get a parameter from a http request, or an empty string if the http request...
Moua asked 17/7, 2015 at 10:31

1

Solved

I have got a strange error and cannot find a solution: * What went wrong: Execution failed for task ':app:compileDebugAndroidTestGroovy'. > Unable to load class de.rheinfabrik.mvvm_example.acti...
Artemas asked 1/7, 2015 at 14:47

1

I have a test spec in Spock and I want to apply the same tests to another alternative with exception of one method. I extend the original spec, implement some custom stuff related to the alternativ...
Deflocculate asked 5/6, 2015 at 10:19

2

How can I implement Groovy's new traits in my Grails Spock tests? Every time I try, I get a stacktrace that looks like this. Is there some limitation of Groovy trails that I might not be aware of? ...
Caspian asked 2/12, 2014 at 21:48

1

Solved

During a recent code review, the question came up regarding whether the @Unroll annotation belongs at the class level or the method level. The class in question requires @Unroll on most of its meth...
Gosh asked 1/6, 2015 at 15:28

1

Solved

I have a code and I want to put method invocation value in the name of the method. @Unroll def 'check #file other text'() { setup: def file = allProperties.keySet().getAt(0) ... where: ... ...
Useful asked 18/5, 2015 at 15:18

1

Solved

The problem I encountered is when I try to verify in the then block that an exception has been thrown, and that call on a mock has been made. Look at the setup below: class B { def b(A a) { a....
Sungkiang asked 30/4, 2015 at 11:44

2

Solved

I ran into something strange when doing some data-driven testing in Groovy. If it matters, this is inside a Spock test. Here is the way, I think, that lists are supposed to work: def list = [[1,...
Gnathion asked 8/4, 2015 at 17:44

1

Solved

First, in case there is a simpler way to solve this problem, here is an outline of what I am trying to accomplish. I want to Annotate my test methods with a KnownIssue annotation (extending Abstrac...
Jello asked 27/3, 2015 at 23:56

© 2022 - 2024 — McMap. All rights reserved.