targets for a Griffon plugin

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

targets for a Griffon plugin

Hamlet D'Arcy

Hi Peter (and everyone else),

i have quite a lot to do right now, so I thought I'd procrastinate by
writing a Griffon Plugin for Spock.

Mostly I use the "when: then: " syntax, so I want this griffon command:
  griffon spock whenthen [testname]
to create a test case template with a "when: then:" block for me.

Also, I could support an "expect: where:" syntax with this griffon comand:
  griffon spock expectwhere [testname[
to create a test case template with an "expect: where:" block.

What are the common patterns of test method that people use? Is a
"when: then:" and "expect: where:" support enough? Is this how other
people use Spock? To be honest, I just "when: then:" for most my
cases, and only use "expect: where:" rarely.

--
Hamlet D'Arcy
[hidden email]

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Spock Framework" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.de/group/spockframework?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: targets for a Griffon plugin

Luke Daley-2

This creates a test file with one test using the given “template”?

--

LD.

On 12/11/2009, at 4:26 PM, "Hamlet D'Arcy" <[hidden email]> wrote:

>
> Hi Peter (and everyone else),
>
> i have quite a lot to do right now, so I thought I'd procrastinate by
> writing a Griffon Plugin for Spock.
>
> Mostly I use the "when: then: " syntax, so I want this griffon  
> command:
>  griffon spock whenthen [testname]
> to create a test case template with a "when: then:" block for me.
>
> Also, I could support an "expect: where:" syntax with this griffon  
> comand:
>  griffon spock expectwhere [testname[
> to create a test case template with an "expect: where:" block.
>
> What are the common patterns of test method that people use? Is a
> "when: then:" and "expect: where:" support enough? Is this how other
> people use Spock? To be honest, I just "when: then:" for most my
> cases, and only use "expect: where:" rarely.
>
> --
> Hamlet D'Arcy
> [hidden email]
>
> >

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Spock Framework" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.de/group/spockframework?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: targets for a Griffon plugin

Hamlet D'Arcy

Yes, that is correct. It mirrors what the easyb or FEST plugins do.

griffon createwhenthen would create a speck with one test method templated out
griffon createexpectwhere would create a speck with a different test
method templated out

--
Hamlet D'Arcy
[hidden email]


On Thu, Nov 12, 2009 at 1:55 AM, Luke Daley <[hidden email]> wrote:

>
> This creates a test file with one test using the given “template”?
>
> --
>
> LD.
>
> On 12/11/2009, at 4:26 PM, "Hamlet D'Arcy" <[hidden email]> wrote:
>
>>
>> Hi Peter (and everyone else),
>>
>> i have quite a lot to do right now, so I thought I'd procrastinate by
>> writing a Griffon Plugin for Spock.
>>
>> Mostly I use the "when: then: " syntax, so I want this griffon
>> command:
>>  griffon spock whenthen [testname]
>> to create a test case template with a "when: then:" block for me.
>>
>> Also, I could support an "expect: where:" syntax with this griffon
>> comand:
>>  griffon spock expectwhere [testname[
>> to create a test case template with an "expect: where:" block.
>>
>> What are the common patterns of test method that people use? Is a
>> "when: then:" and "expect: where:" support enough? Is this how other
>> people use Spock? To be honest, I just "when: then:" for most my
>> cases, and only use "expect: where:" rarely.
>>
>> --
>> Hamlet D'Arcy
>> [hidden email]
>>
>> >
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Spock Framework" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.de/group/spockframework?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: targets for a Griffon plugin

Peter Niederwieser
Administrator
In reply to this post by Hamlet D'Arcy

Hi Hamlet,

great to hear you are working on a Griffon plugin!

On Nov 12, 7:26 am, "Hamlet D'Arcy" <[hidden email]> wrote:
> What are the common patterns of test method that people use?

I tend to use "when-then" for describing side effects of an operation,
and "expect" (with or without "where") for describing expected return
values.

Would it be possible to support any combination of blocks, e.g.
"griffon spock givenwhenthenwhere MySpec"? Or is it necessary to hard-
code this?

Cheers,
Peter
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Spock Framework" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.de/group/spockframework?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: targets for a Griffon plugin

Peter Niederwieser
Administrator

Thinking about this again, I suggest to leave method bodies empty. My
feeling is that providing multiple templates with different
combinations of blocks complicates matters more than it helps. Maybe
one could have different templates for unit, integration, and
functional specs though. That's what we are planning to do for the
Grails plugin.

Cheers,
Peter

On Nov 12, 4:46 pm, Peter Niederwieser <[hidden email]> wrote:

> Hi Hamlet,
>
> great to hear you are working on a Griffon plugin!
>
> On Nov 12, 7:26 am, "Hamlet D'Arcy" <[hidden email]> wrote:
>
> > What are the common patterns of test method that people use?
>
> I tend to use "when-then" for describing side effects of an operation,
> and "expect" (with or without "where") for describing expected return
> values.
>
> Would it be possible to support any combination of blocks, e.g.
> "griffon spock givenwhenthenwhere MySpec"? Or is it necessary to hard-
> code this?
>
> Cheers,
> Peter
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Spock Framework" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.de/group/spockframework?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: targets for a Griffon plugin

Hamlet D'Arcy
Here is an update to the Spock Griffon plugin:

It all works great as long as Griffon updates internally to JUnit 4. I
created a defect for this, so _please_ go vote on it!
http://jira.codehaus.org/browse/GRIFFON-107

Without JUnit 4 it means doing a ton of work to change out the default
test runner and I didn't want to do this.

So if Spock users could upvote this link then we could release!

--
Hamlet


On Nov 15, 1:43 pm, Peter Niederwieser <[hidden email]> wrote:

> Thinking about this again, I suggest to leave method bodies empty. My
> feeling is that providing multiple templates with different
> combinations of blocks complicates matters more than it helps. Maybe
> one could have different templates for unit, integration, and
> functional specs though. That's what we are planning to do for the
> Grails plugin.
>
> Cheers,
> Peter
>
> On Nov 12, 4:46 pm, Peter Niederwieser <[hidden email]> wrote:
>
> > Hi Hamlet,
>
> > great to hear you are working on a Griffon plugin!
>
> > On Nov 12, 7:26 am, "Hamlet D'Arcy" <[hidden email]> wrote:
>
> > > What are the common patterns of test method that people use?
>
> > I tend to use "when-then" for describing side effects of an operation,
> > and "expect" (with or without "where") for describing expected return
> > values.
>
> > Would it be possible to support any combination of blocks, e.g.
> > "griffon spock givenwhenthenwhere MySpec"? Or is it necessary to hard-
> > code this?
>
> > Cheers,
> > Peter

--

You received this message because you are subscribed to the Google Groups "Spock Framework" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/spockframework?hl=en.


Reply | Threaded
Open this post in threaded view
|

Re: targets for a Griffon plugin

Peter Niederwieser
Administrator
Hi Hamlet,

thanks for the update. I'll try to find a few more votes. :-) Looking forward to your work! If you need any help or changes from the Spock side, please do tell us. Also, could we turn this into a Spock module, or would you want to keep it an independent project?

Cheers,
Peter

On 10.12.2009, at 20:19, Hamlet D'Arcy wrote:

> Here is an update to the Spock Griffon plugin:
>
> It all works great as long as Griffon updates internally to JUnit 4. I
> created a defect for this, so _please_ go vote on it!
> http://jira.codehaus.org/browse/GRIFFON-107
>
> Without JUnit 4 it means doing a ton of work to change out the default
> test runner and I didn't want to do this.
>
> So if Spock users could upvote this link then we could release!
>
> --
> Hamlet
>
>
> On Nov 15, 1:43 pm, Peter Niederwieser <[hidden email]> wrote:
>> Thinking about this again, I suggest to leave method bodies empty. My
>> feeling is that providing multiple templates with different
>> combinations of blocks complicates matters more than it helps. Maybe
>> one could have different templates for unit, integration, and
>> functional specs though. That's what we are planning to do for the
>> Grails plugin.
>>
>> Cheers,
>> Peter
>>
>> On Nov 12, 4:46 pm, Peter Niederwieser <[hidden email]> wrote:
>>
>>> Hi Hamlet,
>>
>>> great to hear you are working on a Griffon plugin!
>>
>>> On Nov 12, 7:26 am, "Hamlet D'Arcy" <[hidden email]> wrote:
>>
>>>> What are the common patterns of test method that people use?
>>
>>> I tend to use "when-then" for describing side effects of an operation,
>>> and "expect" (with or without "where") for describing expected return
>>> values.
>>
>>> Would it be possible to support any combination of blocks, e.g.
>>> "griffon spock givenwhenthenwhere MySpec"? Or is it necessary to hard-
>>> code this?
>>
>>> Cheers,
>>> Peter
>
> --
>
> You received this message because you are subscribed to the Google Groups "Spock Framework" group.
> To post to this group, send email to [hidden email].
> To unsubscribe from this group, send email to [hidden email].
> For more options, visit this group at http://groups.google.com/group/spockframework?hl=en.
>
>

--

You received this message because you are subscribed to the Google Groups "Spock Framework" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/spockframework?hl=en.


Reply | Threaded
Open this post in threaded view
|

Re: targets for a Griffon plugin

Luke Daley-2
In reply to this post by Hamlet D'Arcy

On 11/12/2009, at 5:19 AM, Hamlet D'Arcy wrote:

> Here is an update to the Spock Griffon plugin:
>
> It all works great as long as Griffon updates internally to JUnit 4. I
> created a defect for this, so _please_ go vote on it!
> http://jira.codehaus.org/browse/GRIFFON-107
>
> Without JUnit 4 it means doing a ton of work to change out the default
> test runner and I didn't want to do this.
>
> So if Spock users could upvote this link then we could release!

If Griffon consumes the new test infrastructure from Grails 1.2, which I think Andres is planning to, moving internally to JUnit 4 won't be necessary.

See: http://code.google.com/p/spock/source/browse/trunk/spock-grails/src/groovy/grails/plugin/spock/test/GrailsSpecTestType.groovy

--

You received this message because you are subscribed to the Google Groups "Spock Framework" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/spockframework?hl=en.


Reply | Threaded
Open this post in threaded view
|

Re: targets for a Griffon plugin

Hamlet D'Arcy
In reply to this post by Peter Niederwieser
> could we turn this into a Spock module, or would you want to keep it an independent project?

It doesn't matter to me. I was going to check the source into the
Griffon plugins repo, but I think we'll want to reuse Luke's Grails
classes, so it will probably be in SPock.

I'll follow up w/ Andres and find out when Grails 1.2 style testing
will be available in Griffon.


--
Hamlet D'Arcy
[hidden email]




On Thu, Dec 10, 2009 at 5:05 PM, Peter Niederwieser <[hidden email]> wrote:

> Hi Hamlet,
>
> thanks for the update. I'll try to find a few more votes. :-) Looking forward to your work! If you need any help or changes from the Spock side, please do tell us. Also, could we turn this into a Spock module, or would you want to keep it an independent project?
>
> Cheers,
> Peter
>
> On 10.12.2009, at 20:19, Hamlet D'Arcy wrote:
>
>> Here is an update to the Spock Griffon plugin:
>>
>> It all works great as long as Griffon updates internally to JUnit 4. I
>> created a defect for this, so _please_ go vote on it!
>> http://jira.codehaus.org/browse/GRIFFON-107
>>
>> Without JUnit 4 it means doing a ton of work to change out the default
>> test runner and I didn't want to do this.
>>
>> So if Spock users could upvote this link then we could release!
>>
>> --
>> Hamlet
>>
>>
>> On Nov 15, 1:43 pm, Peter Niederwieser <[hidden email]> wrote:
>>> Thinking about this again, I suggest to leave method bodies empty. My
>>> feeling is that providing multiple templates with different
>>> combinations of blocks complicates matters more than it helps. Maybe
>>> one could have different templates for unit, integration, and
>>> functional specs though. That's what we are planning to do for the
>>> Grails plugin.
>>>
>>> Cheers,
>>> Peter
>>>
>>> On Nov 12, 4:46 pm, Peter Niederwieser <[hidden email]> wrote:
>>>
>>>> Hi Hamlet,
>>>
>>>> great to hear you are working on a Griffon plugin!
>>>
>>>> On Nov 12, 7:26 am, "Hamlet D'Arcy" <[hidden email]> wrote:
>>>
>>>>> What are the common patterns of test method that people use?
>>>
>>>> I tend to use "when-then" for describing side effects of an operation,
>>>> and "expect" (with or without "where") for describing expected return
>>>> values.
>>>
>>>> Would it be possible to support any combination of blocks, e.g.
>>>> "griffon spock givenwhenthenwhere MySpec"? Or is it necessary to hard-
>>>> code this?
>>>
>>>> Cheers,
>>>> Peter
>>
>> --
>>
>> You received this message because you are subscribed to the Google Groups "Spock Framework" group.
>> To post to this group, send email to [hidden email].
>> To unsubscribe from this group, send email to [hidden email].
>> For more options, visit this group at http://groups.google.com/group/spockframework?hl=en.
>>
>>
>
> --
>
> You received this message because you are subscribed to the Google Groups "Spock Framework" group.
> To post to this group, send email to [hidden email].
> To unsubscribe from this group, send email to [hidden email].
> For more options, visit this group at http://groups.google.com/group/spockframework?hl=en.
>
>
>

--

You received this message because you are subscribed to the Google Groups "Spock Framework" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/spockframework?hl=en.