spock Questions

2

I am trying to unit test a service that has a method requiring a request object. import org.springframework.web.context.request.RequestContextHolder as RCH class AddressService { def update (ac...
Brimstone asked 6/3, 2013 at 22:24

1

Solved

I have a problem with Spock Mock() object. I have a java class I'm trying to test. This class does some ftp stuff I want to mock. My sample code class ReceiveDataTest extends Specification{ Strin...
Tolerance asked 3/7, 2013 at 12:34

1

Solved

I'd like to mock some fluent interface with mock, which is basically a mail builder: this.builder() .from(from) .to(to) .cc(cc) .bcc(bcc) .template(templateId, templateParameter) .send(); ...
Durnan asked 27/5, 2013 at 11:50

1

Previously I used Robot Framework to automate testing of applications, but a new client asked pay attention to Spock + GEB. I've never used it, but I need to quickly compare two of these tool...
Mccreery asked 10/5, 2013 at 9:50

1

Solved

I have looked around and tried different things to no avail. The examples out there on the interwebs are few, and IMHO pretty simple. My use case: (the 'itocNetworkHandler' below is the mock) whe...
Spoilage asked 2/5, 2013 at 5:54

1

Solved

Sorry if this is a newbie question but I would really appreciate any insights the community could offer with regard to a problem I am having with stubbing the following method which I have in a Gra...
Leda asked 21/3, 2013 at 10:16

1

Solved

This seems like it should be pretty straightforward, but I am not seeing how to get access to values in my GebConfig.groovy file. I've tried the following: userName = "myUserName" properties = { ...
Viewer asked 13/3, 2013 at 20:5

1

Solved

I have a test with loops in the then clause: result.each { it.name.contains("foo") it.entity.subEntity == "bar" } for (String obj : result2) { obj.name.contains("foo") obj.entity.subEntity ==...
Ramonramona asked 5/3, 2013 at 13:11

1

Solved

I am a manual tester trying to learn GEB and Spock. To learn these do I have to have prior knowledge of java or groovy? I have been reading the book of GEB, What are the prerequisites, books or lea...
Reaganreagen asked 10/1, 2013 at 1:23

1

Solved

Is there a way to set the order in which tests are executed within an Spock Specification? For example: class MySpec extends IntegrationSpec { def 'test A'... def 'test B'... } I want 'test ...
Alliteration asked 27/11, 2012 at 1:15

1

Solved

Using Spock 0.7 with Grails 2.04. Trying to set up a testing environment. I need some help in regards to testing a list of objects. I have a list of location objects. I want to test a date on each...
Schuck asked 30/10, 2012 at 12:15

1

I am writing unit test using Spock for groovy-2.0 , and using gradle to run. If I write following the test pass. import spock.lang.Specification class MyTest extends Specification { def "test...
Awfully asked 31/1, 2012 at 18:18

1

Solved

I'm asking for help because I don't know what to do with this error... So first of all let me show the stacktrace I get when running my really simple test, what is weird is that my test doesn't see...
Coherence asked 24/1, 2012 at 11:34

1

Solved

Is there a way to accept any number of arguments when mocking a method? For instance if I want to mock those 2 methods: foo(String s); foo(String s, int i); For now, in my test I do: myMockedC...
Anastatius asked 12/1, 2012 at 3:28

2

I have a standard Java project that uses ant for building. I would like to add spock testing to this project without disrupting the current process. What is the minimum set of changes that would al...
Coh asked 6/9, 2011 at 5:42

1

Is there a spock equivalent of TestNG's @Test(threadPoolSize=n) that will allow me test the execution of a test, with multiple threads concurrently? Basically, given a specification like so... cl...
Riptide asked 1/11, 2011 at 9:58

1

Solved

I've been looking into Spock and I've had experience with FitNesse. I'm wondering how would people choose one over the other - if they appear to be addressing the same or similar problem space. A...
Complaisant asked 10/7, 2011 at 20:17

2

After a bit of help here, I am writing a functional web test using Geb and want to test the disabled attribute value of an form submit button both before and after an event has occurred, the flow s...
Palimpsest asked 7/6, 2011 at 16:35

1

Solved

I just had brief looks at easyb and spock , both seem to be similar, however spock seems to be more technically oriented, is there any best practice regarding when to use which ? For example which...
Extend asked 17/3, 2011 at 19:0

2

Solved

I am trying to test a simple service method. That method mainly just returns the results of a criteria query for which I want to test if it returns the one result or not (depending on what is queri...
Bethesde asked 8/3, 2011 at 10:23

© 2022 - 2024 — McMap. All rights reserved.