@RunWith vs extends Specification

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

@RunWith vs extends Specification

Erem
> [from the GREclipse thread]
>This is a bit off-topic, but @RunWith isn't necessary when you extend from class >Specification (which will become mandatory in Spock 0.4).

I gathered from the documentation that this was the case, but if I
don't have @RunWith(Sputnik) then eclipse refuses to run the spec as a
JUnit test. When I try to, it instead it pops up an alert dialog
entitled "JUnit Launch" which contains the text "No JUnit tests found"

For example, this doesn't run but removing the comment does.

=======
import org.junit.runner.RunWith;

import spock.lang.Specification;
import spock.lang.Sputnik;

//@RunWith(Sputnik)
class HelloSpock extends Specification {
        def "can you figure out what I'm up to?"() {
                expect:
                name.size() == size

                where:
                name << ["Kirk", "Spock", "Scotty"]
                size << [4, 5, 6]
        }
}

--

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
|  
Report Content as Inappropriate

Re: @RunWith vs extends Specification

Erem
there was supposed to be a close-braces at the bottom of that class...

On Nov 26, 3:35 pm, Erem <[hidden email]> wrote:

> > [from the GREclipse thread]
> >This is a bit off-topic, but @RunWith isn't necessary when you extend from class >Specification (which will become mandatory in Spock 0.4).
>
> I gathered from the documentation that this was the case, but if I
> don't have @RunWith(Sputnik) then eclipse refuses to run the spec as a
> JUnit test. When I try to, it instead it pops up an alert dialog
> entitled "JUnit Launch" which contains the text "No JUnit tests found"
>
> For example, this doesn't run but removing the comment does.
>
> =======
> import org.junit.runner.RunWith;
>
> import spock.lang.Specification;
> import spock.lang.Sputnik;
>
> //@RunWith(Sputnik)
> class HelloSpock extends Specification {
>         def "can you figure out what I'm up to?"() {
>                 expect:
>                 name.size() == size
>
>                 where:
>                 name << ["Kirk", "Spock", "Scotty"]
>                 size << [4, 5, 6]
>         }
>
> }

--

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
|  
Report Content as Inappropriate

Re: @RunWith vs extends Specification

Peter Niederwieser
Administrator
In reply to this post by Erem
Which version of the Groovy Eclipse plugin are you using? I just
updated from http://dist.codehaus.org/groovy/distributions/greclipse/snapshot/e3.5,
and running the specs in spock-examples works fine for me.

On Nov 27, 12:35 am, Erem <[hidden email]> wrote:
> I gathered from the documentation that this was the case, but if I
> don't have @RunWith(Sputnik) then eclipse refuses to run the spec as a
> JUnit test. When I try to, it instead it pops up an alert dialog
> entitled "JUnit Launch" which contains the text "No JUnit tests found"

--

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
|  
Report Content as Inappropriate

Re: @RunWith vs extends Specification

Erem
Hey Peter,

I just updated to the latest version from the update site and it still
doesn't work w/o @RunWith(Sputnik). Here are all the versions I'm
using. Tell me anything else to provide that would be helpful (e.g.
screen video, zipped project, whatever).

Versions
   Groovy-Eclipse plugin=2.0.0.xx-20091126-2100-e35 (just updated from
repo)
   spock=0.3-groovy-1.7-SNAPSHOT.jar
   junit4=4.5.0.v20090824
   jvm=java-1.6.0-openjdk-1.6.0
   eclipse
platform=3.5.1.R35x_v20090910-9gEeG1_FthkNDSP2odXdThaOu9GFDPn83DGB7

On Nov 27, 9:32 am, Peter Niederwieser <[hidden email]> wrote:

> Which version of the Groovy Eclipse plugin are you using? I just
> updated fromhttp://dist.codehaus.org/groovy/distributions/greclipse/snapshot/e3.5,
> and running the specs in spock-examples works fine for me.
>
> On Nov 27, 12:35 am, Erem <[hidden email]> wrote:
>
> > I gathered from the documentation that this was the case, but if I
> > don't have @RunWith(Sputnik) then eclipse refuses to run the spec as a
> > JUnit test. When I try to, it instead it pops up an alert dialog
> > entitled "JUnit Launch" which contains the text "No JUnit tests found"

--

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
|  
Report Content as Inappropriate

Re: @RunWith vs extends Specification

Peter Niederwieser
Administrator
Strange. Can you try with 0.4-groovy-1.7-SNAPSHOT and JUnit 4.7? If that doesn't help, I suggest to bring this up on the Groovy Eclipse plugin list.

On 27.11.2009, at 21:51, Erem wrote:

> Hey Peter,
>
> I just updated to the latest version from the update site and it still
> doesn't work w/o @RunWith(Sputnik). Here are all the versions I'm
> using. Tell me anything else to provide that would be helpful (e.g.
> screen video, zipped project, whatever).
>
> Versions
>   Groovy-Eclipse plugin=2.0.0.xx-20091126-2100-e35 (just updated from
> repo)
>   spock=0.3-groovy-1.7-SNAPSHOT.jar
>   junit4=4.5.0.v20090824
>   jvm=java-1.6.0-openjdk-1.6.0
>   eclipse
> platform=3.5.1.R35x_v20090910-9gEeG1_FthkNDSP2odXdThaOu9GFDPn83DGB7
>
> On Nov 27, 9:32 am, Peter Niederwieser <[hidden email]> wrote:
>> Which version of the Groovy Eclipse plugin are you using? I just
>> updated fromhttp://dist.codehaus.org/groovy/distributions/greclipse/snapshot/e3.5,
>> and running the specs in spock-examples works fine for me.
>>
>> On Nov 27, 12:35 am, Erem <[hidden email]> wrote:
>>
>>> I gathered from the documentation that this was the case, but if I
>>> don't have @RunWith(Sputnik) then eclipse refuses to run the spec as a
>>> JUnit test. When I try to, it instead it pops up an alert dialog
>>> entitled "JUnit Launch" which contains the text "No JUnit tests found"
>
> --
>
> 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
|  
Report Content as Inappropriate

Re: @RunWith vs extends Specification

Peter Niederwieser
Administrator
Erem,

have you been able to solve this problem?

Cheers,
Peter

On Nov 28, 1:00 am, Peter Niederwieser <[hidden email]> wrote:

> Strange. Can you try with 0.4-groovy-1.7-SNAPSHOT and JUnit 4.7? If that doesn't help, I suggest to bring this up on the Groovy Eclipse plugin list.
>
> On 27.11.2009, at 21:51, Erem wrote:
>
>
>
> > Hey Peter,
>
> > I just updated to the latest version from the update site and it still
> > doesn't work w/o @RunWith(Sputnik). Here are all the versions I'm
> > using. Tell me anything else to provide that would be helpful (e.g.
> > screen video, zipped project, whatever).
>
> > Versions
> >   Groovy-Eclipse plugin=2.0.0.xx-20091126-2100-e35 (just updated from
> > repo)
> >   spock=0.3-groovy-1.7-SNAPSHOT.jar
> >   junit4=4.5.0.v20090824
> >   jvm=java-1.6.0-openjdk-1.6.0
> >   eclipse
> > platform=3.5.1.R35x_v20090910-9gEeG1_FthkNDSP2odXdThaOu9GFDPn83DGB7
>
> > On Nov 27, 9:32 am, Peter Niederwieser <[hidden email]> wrote:
> >> Which version of the Groovy Eclipse plugin are you using? I just
> >> updated fromhttp://dist.codehaus.org/groovy/distributions/greclipse/snapshot/e3.5,
> >> and running the specs in spock-examples works fine for me.
>
> >> On Nov 27, 12:35 am, Erem <[hidden email]> wrote:
>
> >>> I gathered from the documentation that this was the case, but if I
> >>> don't have @RunWith(Sputnik) then eclipse refuses to run the spec as a
> >>> JUnit test. When I try to, it instead it pops up an alert dialog
> >>> entitled "JUnit Launch" which contains the text "No JUnit tests found"
>
> > --
>
> > 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 athttp://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
|  
Report Content as Inappropriate

Re: @RunWith vs extends Specification

Erem
Hey Peter,

Sorry for taking so long on the response. I think the guys at the
eclipse plugin must have fixed it at some point; now it works fine w/o
@RunWith!

Erem

On Dec 10, 5:56 pm, Peter Niederwieser <[hidden email]> wrote:

> Erem,
>
> have you been able to solve this problem?
>
> Cheers,
> Peter
>
> On Nov 28, 1:00 am, Peter Niederwieser <[hidden email]> wrote:
>
> > Strange. Can you try with 0.4-groovy-1.7-SNAPSHOT and JUnit 4.7? If that doesn't help, I suggest to bring this up on the Groovy Eclipse plugin list.
>
> > On 27.11.2009, at 21:51, Erem wrote:
>
> > > Hey Peter,
>
> > > I just updated to the latest version from the update site and it still
> > > doesn't work w/o @RunWith(Sputnik). Here are all the versions I'm
> > > using. Tell me anything else to provide that would be helpful (e.g.
> > > screen video, zipped project, whatever).
>
> > > Versions
> > >   Groovy-Eclipse plugin=2.0.0.xx-20091126-2100-e35 (just updated from
> > > repo)
> > >   spock=0.3-groovy-1.7-SNAPSHOT.jar
> > >   junit4=4.5.0.v20090824
> > >   jvm=java-1.6.0-openjdk-1.6.0
> > >   eclipse
> > > platform=3.5.1.R35x_v20090910-9gEeG1_FthkNDSP2odXdThaOu9GFDPn83DGB7
>
> > > On Nov 27, 9:32 am, Peter Niederwieser <[hidden email]> wrote:
> > >> Which version of the Groovy Eclipse plugin are you using? I just
> > >> updated fromhttp://dist.codehaus.org/groovy/distributions/greclipse/snapshot/e3.5,
> > >> and running the specs in spock-examples works fine for me.
>
> > >> On Nov 27, 12:35 am, Erem <[hidden email]> wrote:
>
> > >>> I gathered from the documentation that this was the case, but if I
> > >>> don't have @RunWith(Sputnik) then eclipse refuses to run the spec as a
> > >>> JUnit test. When I try to, it instead it pops up an alert dialog
> > >>> entitled "JUnit Launch" which contains the text "No JUnit tests found"
>
> > > --
>
> > > 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 athttp://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
|  
Report Content as Inappropriate

Re: @RunWith vs extends Specification

Erem
Ugh nevermind. Seems like without @RunWith(Sputnik) I can run
INDIVIDUAL feature methods in line but not the entire set of feature
methods.

I tried upgrading to 0.4-groovy-1.7-SNAPSHOT but haven't tried junit
4.7 yet...

On Dec 16, 3:27 pm, Erem <[hidden email]> wrote:

> Hey Peter,
>
> Sorry for taking so long on the response. I think the guys at the
> eclipse plugin must have fixed it at some point; now it works fine w/o
> @RunWith!
>
> Erem
>
> On Dec 10, 5:56 pm, Peter Niederwieser <[hidden email]> wrote:
>
> > Erem,
>
> > have you been able to solve this problem?
>
> > Cheers,
> > Peter
>
> > On Nov 28, 1:00 am, Peter Niederwieser <[hidden email]> wrote:
>
> > > Strange. Can you try with 0.4-groovy-1.7-SNAPSHOT and JUnit 4.7? If that doesn't help, I suggest to bring this up on the Groovy Eclipse plugin list.
>
> > > On 27.11.2009, at 21:51, Erem wrote:
>
> > > > Hey Peter,
>
> > > > I just updated to the latest version from the update site and it still
> > > > doesn't work w/o @RunWith(Sputnik). Here are all the versions I'm
> > > > using. Tell me anything else to provide that would be helpful (e.g.
> > > > screen video, zipped project, whatever).
>
> > > > Versions
> > > >   Groovy-Eclipse plugin=2.0.0.xx-20091126-2100-e35 (just updated from
> > > > repo)
> > > >   spock=0.3-groovy-1.7-SNAPSHOT.jar
> > > >   junit4=4.5.0.v20090824
> > > >   jvm=java-1.6.0-openjdk-1.6.0
> > > >   eclipse
> > > > platform=3.5.1.R35x_v20090910-9gEeG1_FthkNDSP2odXdThaOu9GFDPn83DGB7
>
> > > > On Nov 27, 9:32 am, Peter Niederwieser <[hidden email]> wrote:
> > > >> Which version of the Groovy Eclipse plugin are you using? I just
> > > >> updated fromhttp://dist.codehaus.org/groovy/distributions/greclipse/snapshot/e3.5,
> > > >> and running the specs in spock-examples works fine for me.
>
> > > >> On Nov 27, 12:35 am, Erem <[hidden email]> wrote:
>
> > > >>> I gathered from the documentation that this was the case, but if I
> > > >>> don't have @RunWith(Sputnik) then eclipse refuses to run the spec as a
> > > >>> JUnit test. When I try to, it instead it pops up an alert dialog
> > > >>> entitled "JUnit Launch" which contains the text "No JUnit tests found"
>
> > > > --
>
> > > > 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 athttp://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
|  
Report Content as Inappropriate

Re: @RunWith vs extends Specification

Peter Niederwieser
Administrator
Erem,

Have you tried running a spec by right-clicking the spec CLASS in the Eclipse project explorer? Running a spec by right-clicking the spec FILE doesn't work yet. This is a known problem that the Groovy Eclipse folks are trying to fix right now.

Cheers,
Peter

On 17.12.2009, at 00:45, Erem wrote:

> Ugh nevermind. Seems like without @RunWith(Sputnik) I can run
> INDIVIDUAL feature methods in line but not the entire set of feature
> methods.
>
> I tried upgrading to 0.4-groovy-1.7-SNAPSHOT but haven't tried junit
> 4.7 yet...
>
> On Dec 16, 3:27 pm, Erem <[hidden email]> wrote:
>> Hey Peter,
>>
>> Sorry for taking so long on the response. I think the guys at the
>> eclipse plugin must have fixed it at some point; now it works fine w/o
>> @RunWith!
>>
>> Erem
>>
>> On Dec 10, 5:56 pm, Peter Niederwieser <[hidden email]> wrote:
>>
>>> Erem,
>>
>>> have you been able to solve this problem?
>>
>>> Cheers,
>>> Peter
>>
>>> On Nov 28, 1:00 am, Peter Niederwieser <[hidden email]> wrote:
>>
>>>> Strange. Can you try with 0.4-groovy-1.7-SNAPSHOT and JUnit 4.7? If that doesn't help, I suggest to bring this up on the Groovy Eclipse plugin list.
>>
>>>> On 27.11.2009, at 21:51, Erem wrote:
>>
>>>>> Hey Peter,
>>
>>>>> I just updated to the latest version from the update site and it still
>>>>> doesn't work w/o @RunWith(Sputnik). Here are all the versions I'm
>>>>> using. Tell me anything else to provide that would be helpful (e.g.
>>>>> screen video, zipped project, whatever).
>>
>>>>> Versions
>>>>>   Groovy-Eclipse plugin=2.0.0.xx-20091126-2100-e35 (just updated from
>>>>> repo)
>>>>>   spock=0.3-groovy-1.7-SNAPSHOT.jar
>>>>>   junit4=4.5.0.v20090824
>>>>>   jvm=java-1.6.0-openjdk-1.6.0
>>>>>   eclipse
>>>>> platform=3.5.1.R35x_v20090910-9gEeG1_FthkNDSP2odXdThaOu9GFDPn83DGB7
>>
>>>>> On Nov 27, 9:32 am, Peter Niederwieser <[hidden email]> wrote:
>>>>>> Which version of the Groovy Eclipse plugin are you using? I just
>>>>>> updated fromhttp://dist.codehaus.org/groovy/distributions/greclipse/snapshot/e3.5,
>>>>>> and running the specs in spock-examples works fine for me.
>>
>>>>>> On Nov 27, 12:35 am, Erem <[hidden email]> wrote:
>>
>>>>>>> I gathered from the documentation that this was the case, but if I
>>>>>>> don't have @RunWith(Sputnik) then eclipse refuses to run the spec as a
>>>>>>> JUnit test. When I try to, it instead it pops up an alert dialog
>>>>>>> entitled "JUnit Launch" which contains the text "No JUnit tests found"
>>
>>>>> --
>>
>>>>> 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 athttp://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.


Loading...