Code Monkey home page Code Monkey logo

spock's People

Watchers

 avatar

spock's Issues

stack trace filtering improvements

additional classes to be filtered:
groovy.lang.MetaClassImpl
groovy.lang.MetaMethod

feature method names should be fixed up in closures too:
org.spockframework.smoke.OldValues$___feature4_closure1.doCall

Original issue reported on code.google.com by [email protected] on 4 Apr 2009 at 12:13

How should we handle features whose data providers return different number of values?

Example:

{{{
expect:
x == y

where:
x << [1, 2, 3]
y << [1, 2]
}}}

Currently this passes (number of iterations is minimum number of values 
returned by a data 
provider). Alternatively, we might issue a warning, insert nulls once a data 
provider runs out of 
values, or let the feature / last iteration fail.

Pros of the current approach:
 * Might be convenient if external data is involved (however this is speculation)
 * In line with the tolerant nature of scripting languages

Cons of the current approach:
 * No feedback if data is missing accidentally

Original issue reported on code.google.com by [email protected] on 11 Jun 2009 at 1:02

Support specification scripts

Ideas:
 - Groovy script that imports @Speck is considered a specification
 - Script class is annotated with @Speck and @RunWith behind the scenes
 - Make sure that the specification is also run when the script's main method is invoked (important 
for tools that fail to identify the script as a specification (e.g. IDEs))

Original issue reported on code.google.com by [email protected] on 26 Jun 2009 at 9:30

Custom Ant selector for Speck class files

Selector can then be used in JUnit task to run all Specks regardless of
their name (cf. find-specks Maven goal).

Open question: Should we search for classes annotated with @Speck, classes
annotated with @RunWith, classes with at least one @Test method, or classes
satisfying any or a combination of these criteria?

Original issue reported on code.google.com by [email protected] on 4 Mar 2009 at 6:23

Error in setupSpeck() causes NPE

java.lang.NullPointerException
    at
org.spockframework.runtime.JUnitSupervisor.getFeatureDescription(JUnitSupervisor
.java:90)
    at org.spockframework.runtime.JUnitSupervisor.error(JUnitSupervisor.java:61)
    at
org.spockframework.runtime.SpeckInfoBaseRunner.invokeRaw(SpeckInfoBaseRunner.jav
a:181)
    at
org.spockframework.runtime.SpeckInfoBaseRunner.invoke(SpeckInfoBaseRunner.java:1
61)
    at
org.spockframework.runtime.SpeckInfoBaseRunner.invokeSetupSpeck(SpeckInfoBaseRun
ner.java:98)
    at
org.spockframework.runtime.SpeckInfoBaseRunner.run(SpeckInfoBaseRunner.java:78)
    at spock.lang.Sputnik.run(Sputnik.java:47)
    at com.intellij.rt.junit4.Junit4ClassSuite.run(Junit4ClassSuite.java:99)
    at junit.textui.TestRunner.doRun(TestRunner.java:116)
    at
com.intellij.rt.execution.junit.IdeaTestRunner.doRun(IdeaTestRunner.java:94)
    at junit.textui.TestRunner.doRun(TestRunner.java:109)
    at
com.intellij.rt.execution.junit.IdeaTestRunner.startRunnerWithArgs(IdeaTestRunne
r.java:22)
    at
com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter
.java:118)
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)

Original issue reported on code.google.com by [email protected] on 10 Mar 2009 at 6:40

Better stack traces for unsatisfied interactions

Too few invocations: Completely synthetic stack trace(s) that point(s) to all 
affected interactions
Too many invocations: Truncate after call to matching method, replace name of 
proxy class (e.g. 
$Proxy9)

Original issue reported on code.google.com by [email protected] on 3 Apr 2009 at 4:53

Support ordered interactions

Make it possible to impose a partial order on interactions.

Example:

when: // ...
then: 1 * x.foo(); 1 * y.foo()
then: 1 * x.bar()

1 * x.foo() and 1 * y.foo() are unordered with respect to each other, but 1
* x.bar() comes after them (the exact meaning of which still has to be
worked out).

Original issue reported on code.google.com by [email protected] on 6 Mar 2009 at 3:54

Filter stacktraces

Stacktraces presented to the user should have all internal MOP calls
removed (no more, no less).

Original issue reported on code.google.com by [email protected] on 6 Mar 2009 at 3:56

Support per test cleanup

I hit the case where I need a cleanup for a certain test. It would be nice if 
there was an 
after/cleanup clause…

def t() {
  setup:
    // swap in fake streams for System.out and System.err

  then:
    // do some stuff that produces output

  expect:
    // what was written to System.out was correct

  cleanup: // maybe ‘after’ as a synonym?
    // restore real System.out and System.err
}

Original issue reported on code.google.com by [email protected] on 24 Oct 2009 at 6:16

Base class for specifications

Add a base class for specification, either as an alternative or a replacement 
for the current way to 
designate specifications. 

Old:
{{{
import org.junit.runner.RunWith
import spock.lang.Speck
import static spock.lang.Predef.*

@Speck
@RunWith(Sputnik)
class Foo {}
}}}

New:
{{{
import spock.lang.Specification

class Foo extends Specification {}
}}}

Plus:
 * shorter and nicer on the eye
 * saves static imports (static imports are difficult for IDEs to insert automatically, and "bind" 
stronger in Groovy than they do in Java)

Minus:
 * might inspire Spock extensions to use inheritance (two such extensions cannot be used 
together)
 * specification that inherits from specification in different compilation unit might be hard to 
recognize for Spock compiler and test runners
 * reputation as anti-pattern since JUnit switched to annotations

Original issue reported on code.google.com by [email protected] on 11 Jun 2009 at 12:36

Work out intended semantics of overlapping interactions

This is a design issue not an implementation issue.

Example:
{{{
when:
foo.bar("hi")
foo.bar("hi")

then:
1 * foo.bar("hi")
1 * foo.bar(_)
}}}

Currently this fails because the first interaction matches too often (twice
instead of once). But it might be reasonable to give the second interaction
a chance to match the second invocation before letting the first
interaction fail.
A related question is what should happen if the second interaction were global.

Original issue reported on code.google.com by [email protected] on 6 Mar 2009 at 3:11

Improved support for mocking Groovy classes

Invoking regular methods on such mocks should already work, but invoking
GDK and dynamic methods is not yet supported.
What should we do if a GDK/dynamic method is invoked that doesn't match any
interaction? Should we be graceful, or should we issue an error?

Original issue reported on code.google.com by [email protected] on 6 Mar 2009 at 3:37

Support different kinds of mock objects

Currently, all mocks are lenient. It would be nice to also have mocks that
- are strict
- have other default return values (empty collection, dummy mock, etc.)

Syntax suggestions:
SMock(), StrictMock(), Mock(strict: true), Mock("strict")
IMock(), IntelliMock(), Mock(intelligent: true), Mock("intelligent")

It might also make sense to have mocks that combine several of these
properties.

Original issue reported on code.google.com by [email protected] on 6 Mar 2009 at 4:08

Run tests in parallel

I have an enhancement request to make tests run in parallel. I like Spock
so much, I'm using it to run some validation tests that run over a large
dataset. I use the data provider way and @Unroll to run the tests as unique
tests. They work great, except they run serially and I'd like to use up all
the cores that the machine has (> 4).

Original issue reported on code.google.com by [email protected] on 17 Jul 2009 at 9:42

intermittant JVMTI memory error in IntelliJ IDEA debugger

What steps will reproduce the problem?
0. Use IntelliJ IDEA EAP build (I don't think this is IntelliJ issue though)
1. Create a new Groovy Script with the HelloSpock example
2. Set two breakpoints: at name<< and size<< 
3. Debug the script, wait a second and resume at each breakpoint. 
4. Error occurs for me roughly 1 out of 4 times. 

What is the expected output? What do you see instead?
I expect test to pass without a JVM error
The test fails with a JVM error: 
FATAL ERROR in native method: JDWP on getting class status,
jvmtiError=JVMTI_ERROR_WRONG_PHASE(112)
JDWP exit error JVMTI_ERROR_WRONG_PHASE(112): on getting class status
[../././rc/hare/ack/til.c:1265]

or 

FATAL ERROR in native method: JDWP Can't allocate jvmti memory,
jvmtiError=JVMTI_ERROR_INVALID_ENVIRONMENT(116)
JDWP exit error JVMTI_ERROR_WRONG_PHASE(112): on getting class status
[../././rc/hare/ack/til.c:1265]
JDWP exit error JVMTI_ERROR_INVALID_ENVIRONMENT(116): Can't allocate jvmti
memory [../././rc/hare/ack/til.c:1779]
ERROR: JDWP unable to dispose of JVMTI environment:
JVMTI_ERROR_INVALID_ENVIRONMENT(116)


What version of the product are you using? On what operating system?
Spock 0.1
Win XP
Junit 4.4
IDEA 9 EAP
Groovy 1.7 snapshot build today
Java 1.6.04

Please provide any additional information below.

Hopefully this is an IDEA or Java issue. Otherwise, I'm sorry. This one
doesn't look fun to debug. 

Original issue reported on code.google.com by HamletDRC on 31 May 2009 at 11:09

Provide a way to access "old" values

Example:
{{{
when: stack.push("elem")
then: stack.size() == old stack.size() + 1
}}

Here, Predef.old(_expr_) refers to the value of _expr_ before the when
block was entered.

Original issue reported on code.google.com by [email protected] on 6 Mar 2009 at 3:24

Tapestry IOC support

Features: 
 * Start up and shut down Tapestry modules
 * Inject service, symbols, and values into specifications

Original issue reported on code.google.com by [email protected] on 1 Sep 2009 at 1:18

Spock web console

Similar to http://groovyconsole.appspot.com/
Could fork http://github.com/glaforge/groovywebconsole/tree/master

Original issue reported on code.google.com by [email protected] on 26 Jul 2009 at 4:02

Call void methods from expect/then blocks

It should be possible to call void methods from expect and when blocks. Such 
method calls should 
not be considered implicit conditions, just as variable declarations aren't 
considered implicit 
conditions.

Usages:
 * println "debug message"
 * conditionInHelperMethod()
 * assertionApiCall()

Original issue reported on code.google.com by [email protected] on 26 May 2009 at 1:17

More powerful @Timeout

It should be possible to apply @Timeout to a whole Speck
When applied to a feature method, @Timeout should (at least optionally) include 
all iterations, 
setup(), and cleanup()

This feature is a great challenge for our extension mechanism.

Original issue reported on code.google.com by [email protected] on 26 May 2009 at 1:59

Support Spock in GroovyConsole

What steps will reproduce the problem?
1. Open GroovyConsole
2. Add spock/junit jars thru "add jar to classpath" menu item
3. Try to run HelloSpock

What is the expected output? What do you see instead?
I expected the code to at least compile. Instead I got a stack trace: 
Exception thrown: null line detected; lineNum=11, expr=(name.size() == size)

What version of the product are you using? On what operating system?
Win XP . Spock 0.1

Please provide any additional information below.
I don't actually care about running the specks in GroovyConsole, I just
wanted to use the ASTViewer to see what AST was being created so that I
could understand how Spock workd. 

Original issue reported on code.google.com by HamletDRC on 31 May 2009 at 3:08

where block cannot access or declare variables?

i would expect to be able to do this:

def "my test"() {
  given:
      def a = new Apple()
      def o = new Orange()

  when:
      fruit = f
  then: 
      <something>
  where:
       f << [a, o, a, o, a, o]  
}

But I get MissingPropertyException for a & o.  I also tried declaring a & o in 
the where block - same issue.  Declaring them outside the 
scope of the method works but is not ideal.  I ended up unrolling the where 
into several when/then blocks.

I see that the documentation for the where block is coming (at light speed :) 
so maybe this is as designed.

Thanks

Original issue reported on code.google.com by [email protected] on 12 Mar 2009 at 6:07

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.