Code Monkey home page Code Monkey logo

instinct's People

Contributors

synesso avatar

Watchers

 avatar

instinct's Issues

Wiki could do with a FAQ Entry

Potential initial entries:

Supported versions of JDK (potentially specific to which features you are
using)?

Dependencies?

Related projects?

Original issue reported on code.google.com by [email protected] on 25 Dec 2006 at 10:45

Abstract classes are being run as a result of specification runner refactoring

 [instinct] - shouldThrowAnIllegalArumentExceptionIfAnAddedEventIsNull (FAILED)
 [instinct] 
 [instinct]     java.lang.RuntimeException: Cannot instantiate the constructor of an abstract class: 
com.googlecode.instinct.example.calendar.AbstractEventCalendarContext
 [instinct]         at 
com.googlecode.instinct.internal.reflect.ConstructorInvokerImpl.checkClassIsNotA
bstract(Constr
uctorInvokerImpl.java:49)
 [instinct]         at 
com.googlecode.instinct.internal.reflect.ConstructorInvokerImpl.invokeNullaryCon
structor(Constr
uctorInvokerImpl.java:32)
 [instinct]         at 
com.googlecode.instinct.internal.runner.SpecificationRunnerImpl.invokeConstructo
r(Specification
RunnerImpl.java:129)
 [instinct]         at 
com.googlecode.instinct.internal.runner.SpecificationRunnerImpl.runSpecification
(SpecificationRu
nnerImpl.java:69)
 [instinct]         at 
com.googlecode.instinct.internal.runner.SpecificationRunnerImpl.run(Specificatio
nRunnerImpl.jav
a:58)
 [instinct]         at 
com.googlecode.instinct.internal.core.ExpectingExceptionSpecificationMethod.run(
ExpectingExce
ptionSpecificationMethod.java:97)
 [instinct]         at 
com.googlecode.instinct.internal.runner.StandardContextRunner$1.e(StandardContex
tRunner.jav
a:62)
 [instinct]         at 
com.googlecode.instinct.internal.runner.StandardContextRunner$1.e(StandardContex
tRunner.jav
a:59)
 [instinct]         at fj.data.List.foreach(List.java:225)
 [instinct]         at 
com.googlecode.instinct.internal.runner.StandardContextRunner.runSpecifications(
StandardCont
extRunner.java:59)
 [instinct]         at 
com.googlecode.instinct.internal.runner.StandardContextRunner.runContextClass(St
andardConte
xtRunner.java:53)
 [instinct]         at 
com.googlecode.instinct.internal.runner.StandardContextRunner.run(StandardContex
tRunner.jav
a:46)
 [instinct]         at 
com.googlecode.instinct.internal.core.ContextClassImpl.run(ContextClassImpl.java
:58)
 [instinct]         at 
com.googlecode.instinct.internal.core.ContextClassImpl.run(ContextClassImpl.java
:28)
 [instinct]         at 
com.googlecode.instinct.runner.CommandLineRunner.run(CommandLineRunner.java:97)
 [instinct]         at 
com.googlecode.instinct.runner.CommandLineRunner.main(CommandLineRunner.java:132
)
 [instinct] 


Original issue reported on code.google.com by [email protected] on 24 Jul 2008 at 10:01

Example project pom.xml isn't correct.

What steps will reproduce the problem?
1. Download example project
2. Execute 'mvn package'

What is the expected output? What do you see instead?

Expect to see project build, including all tests. Instead maven complains
about java 1.3 not supporting Java 5 language features. Some changes are
required to the pom.

What version of the product are you using? On what operating system?
n/a

Please provide any additional information below.

The java language error is just the first in a chain of errors to be
corrected. Other issues resolved are:

* functionaljava dependency not included
* test source directory is src/test/java, not src/spec/java
* tests to be executed default to *Test.class, which excludes all
specifications
* after changing test inclusions to **/*.class, non spec classes needed to
be excluded, including **/util/* and anonymous inner classes **/*$*
* test resources directory defaults to src/test/resources, not
src/spec/resources

I have modified the POM so that these issues are corrected. The modified
pom is attached.

The project now runs the specs via the surefire plugin. I have not looked
into generating reports. Also, I have not looked into the purpose of the
scala files. This may be functionality missing from the build.

Original issue reported on code.google.com by [email protected] on 23 Aug 2008 at 6:31

Attachments:

Add more matchers for FJ data types

To continue the Revolution, instinct needs a few more matchers of data
types from functional java:
eg.
expect.that(Option.<Integer>some(5).isSomeWith(5); //horrible name, I think

A list of potential matchers:
* Option
** isNone
** isSome
** isSomeWith(value)

* Either
** isLeft
** isRight
** isXxxProjectedWith(value)

Feedback on the names we should adopt here, and more matchers, would be good.

Original issue reported on code.google.com by [email protected] on 28 Jul 2008 at 7:03

CollectionChecker.hasTheSameContentAs() is broken

@Specification
    public void shouldNotFailAndDoesntYay() {
        final List<Integer> expected = asList(1,1,3,4);
        final List<Integer> returned = asList(1,2,4,3);
        expect.that(expected).hasTheSameContentAs(returned);
    }

    @Specification
    public void shouldNotFailButDoesYouNoob() {
        final List<Integer> expected = asList(1, 1, 3, 4);
        final List<Integer> returned = asList(1, 2, 4, 3);
        expect.that(returned).hasTheSameContentAs(expected);
    }

http://pastie.caboo.se/138076

Original issue reported on code.google.com by [email protected] on 11 Jan 2008 at 5:55

Add newlines between context output in brief runner

Using the following script

------------------->8-------------------
// require(url:'http://code.google.com/p/instinct', jar:'instinct-0.1.4.jar')
// require(url:'http://geekscape.org/static/boost.html', jar:'boost-982.jar')
import com.googlecode.instinct.marker.annotate.*
import com.googlecode.instinct.runner.TextContextRunner
import com.googlecode.instinct.internal.core.ContextClassImpl

//@Context
class A_Default_Storer {
   def storer

   @BeforeSpecification
   void setUp() {
       storer = new Storer()
   }

   private checkPersistAndReverse(value, reverseValue) {
       storer.put(value)
       assert value == storer.get()
       assert reverseValue == storer.getReverse()
   }

   @Specification
   def should_Reverse_Numbers() {
       checkPersistAndReverse 123.456, -123.456
   }

   @Specification
   def should_Reverse_Strings() {
       checkPersistAndReverse 'hello', 'olleh'
   }

   @Specification
   def should_Reverse_Lists() {
       checkPersistAndReverse([1, 3, 5], [5, 3, 1])
   }
}

new TextContextRunner().run(new ContextClassImpl(A_Default_Storer))
------------------->8-------------------

I would expect TextContextRunner to create the new ContextClassImpl()
for me so that the internal class isn't visible, or at least provide
that as an option.

The output is:
A_Default_Storer
- should_Reverse_Lists- should_Reverse_Numbers- should_Reverse_Strings

I would expect NEW_LINEs after each result message.

Original issue reported on code.google.com by [email protected] on 30 May 2007 at 9:33

Stub creator causes NPEs

As it uses Objenesis, it doesn't call constructor args, so any method that 
depends on constructor 
args could throw NPEs.

Better solution would be to fill out all constructor params (and possibly 
descend recursively with 
stub creator).

Another option is to wrap a proxy, and intercept method calls and create a stub 
for the return 
type. This approach probably breaks the expected behaviour of methods such as 
toString(), etc.

Note. in head, not in release build.

Original issue reported on code.google.com by [email protected] on 15 Nov 2007 at 10:49

Add summary totals across all contexts when reporting results

The brief & verbose formatters currently report result summaries for each
context run. Should add something that also totals these across all
contexts run. e.g.

Context: Foo; Successes: 2; Failures: 1
Context: Bar; Successes: 2; Failures: 1
Total: Successes: 4; Failures: 2

Original issue reported on code.google.com by [email protected] on 22 Apr 2007 at 11:14

Throwing exception out of mocked code confused expected exception handling

@Stub private Exception throwable;
@Stub private RuntimeException sanitisedException;

@Specification(expectedException = KahunaException.class)
public void delegatesToTheExceptionSanitizerForAllExceptions() throws
Throwable {
    expect.that(new Expectations() {
        {
            one(call).proceed(); will(throwException(throwable));
        }
    });
    aspect.sanitize(call);
}

Results in:

java.lang.RuntimeException

Original issue reported on code.google.com by [email protected] on 25 Nov 2007 at 10:27

Expected exceptions are being printed to console in Ant runner even though spec passes

[instinct] - throwsExceptionWhenANullIsPushed (FAILED)
 [instinct] 
 [instinct]     java.lang.IllegalArgumentException
 [instinct]         at com.googlecode.instinct.example.stack.StackImpl.push(StackImpl.java:15)
 [instinct]         at 
com.googlecode.instinct.example.stack.ANonEmptyStack.throwsExceptionWhenANullIsP
ushed(AN
onEmptyStack.java:49)
 [instinct]         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 [instinct]         at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 [instinct]         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:25)
 [instinct]         at java.lang.reflect.Method.invoke(Method.java:597)
 [instinct]         at 
com.googlecode.instinct.internal.edge.java.lang.reflect.MethodEdgeImpl.invoke(Me
thodEdgeImpl.
java:32)
 [instinct]         at 
com.googlecode.instinct.internal.util.MethodInvokerImpl.invokeMethod(MethodInvok
erImpl.java:
32)
 [instinct]         at 
com.googlecode.instinct.internal.util.MethodInvokerImpl.invokeMethod(MethodInvok
erImpl.java:
27)
 [instinct]         at 
com.googlecode.instinct.internal.runner.SpecificationRunnerImpl.runSpecification
Method(Specific
ationRunnerImpl.java:97)
 [instinct]         at 
com.googlecode.instinct.internal.runner.SpecificationRunnerImpl.runSpecification
Lifecycle(Specifi
cationRunnerImpl.java:84)
 [instinct]         at 
com.googlecode.instinct.internal.runner.SpecificationRunnerImpl.runSpecification
(SpecificationRu
nnerImpl.java:70)
 [instinct]         at 
com.googlecode.instinct.internal.runner.SpecificationRunnerImpl.run(Specificatio
nRunnerImpl.jav
a:58)
 [instinct]         at 
com.googlecode.instinct.internal.core.ExpectingExceptionSpecificationMethod.run(
ExpectingExce
ptionSpecificationMethod.java:97)
 [instinct]         at 
com.googlecode.instinct.internal.runner.StandardContextRunner$1.e(StandardContex
tRunner.jav
a:62)
 [instinct]         at 
com.googlecode.instinct.internal.runner.StandardContextRunner$1.e(StandardContex
tRunner.jav
a:59)
 [instinct]         at fj.data.List.foreach(List.java:225)
 [instinct]         at 
com.googlecode.instinct.internal.runner.StandardContextRunner.runSpecifications(
StandardCont
extRunner.java:59)
 [instinct]         at 
com.googlecode.instinct.internal.runner.StandardContextRunner.runContextClass(St
andardConte
xtRunner.java:53)
 [instinct]         at 
com.googlecode.instinct.internal.runner.StandardContextRunner.run(StandardContex
tRunner.jav
a:46)
 [instinct]         at 
com.googlecode.instinct.internal.core.ContextClassImpl.run(ContextClassImpl.java
:58)
 [instinct]         at 
com.googlecode.instinct.internal.core.ContextClassImpl.run(ContextClassImpl.java
:28)
 [instinct]         at 
com.googlecode.instinct.runner.CommandLineRunner.run(CommandLineRunner.java:97)
 [instinct]         at 
com.googlecode.instinct.runner.CommandLineRunner.main(CommandLineRunner.java:132
)


Original issue reported on code.google.com by [email protected] on 25 Jul 2008 at 1:56

Autoboxing problem with Double and Boolean

For some reason when something like:

    expect.that(1.1).closeTo(1.0, 0.11);

is written Java 5 does not box the double (1.1) to a Double object, but
instead matches the:

    <T extends Comparable<T>> ComparableChecker<T> that(T comparable);

declaration of 'that', as opposed to the:

    DoubleChecker that(Double d);

declaration of 'that'.

I've tried reordering the declarations in the interface so that the
DoubleChecker version of 'that' appears before the ComparableChecker<T>
version, but to no avail.

The only work around I know of is to write:

    expect.that(new Double(1.1)).closeTo(1.0, 0.11);

Original issue reported on code.google.com by [email protected] on 10 Aug 2007 at 5:01

Can't create stubs for interfaces


java.lang.InstantiationError: org.aspectj.lang.Signature
    at
sun.reflect.GeneratedSerializationConstructorAccessor2.newInstance(Unknown
Source)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at
org.objenesis.instantiator.sun.SunReflectionFactoryInstantiator.newInstance(SunR
eflectionFactoryInstantiator.java:40)
    at org.objenesis.ObjenesisBase.newInstance(ObjenesisBase.java:59)
    at
com.googlecode.instinct.internal.util.instance.ConcreteInstanceProvider.createCo
ncreteInstance(ConcreteInstanceProvider.java:113)
    at
com.googlecode.instinct.internal.util.instance.ConcreteInstanceProvider.newInsta
nce(ConcreteInstanceProvider.java:75)
    at
com.googlecode.instinct.internal.actor.StubCreator.createDouble(StubCreator.java
:33)
    at
com.googlecode.instinct.internal.actor.ActorAutoWirerImpl.autoWireField(ActorAut
oWirerImpl.java:81)
    at
com.googlecode.instinct.internal.actor.ActorAutoWirerImpl.autoWireMarkedFields(A
ctorAutoWirerImpl.java:72)
    at
com.googlecode.instinct.internal.actor.ActorAutoWirerImpl.autoWireStubs(ActorAut
oWirerImpl.java:59)
    at
com.googlecode.instinct.internal.actor.ActorAutoWirerImpl.autoWireFields(ActorAu
toWirerImpl.java:48)
    at
com.googlecode.instinct.internal.runner.SpecificationRunnerImpl.runSpecification
Lifecycle(SpecificationRunnerImpl.java:145)
    at
com.googlecode.instinct.internal.runner.SpecificationRunnerImpl.doNonPendingRun(
SpecificationRunnerImpl.java:80)
    at
com.googlecode.instinct.internal.runner.SpecificationRunnerImpl.doRun(Specificat
ionRunnerImpl.java:69)
    at
com.googlecode.instinct.internal.runner.SpecificationRunnerImpl.run(Specificatio
nRunnerImpl.java:58)
    at
com.googlecode.instinct.internal.core.SpecificationMethodImpl.run(SpecificationM
ethodImpl.java:57)
    at
com.googlecode.instinct.integrate.junit4.SpecificationRunnerImpl.runSpecificatio
n(SpecificationRunnerImpl.java:56)
    at
com.googlecode.instinct.integrate.junit4.SpecificationRunnerImpl.run(Specificati
onRunnerImpl.java:49)
    at
com.googlecode.instinct.integrate.junit4.InstinctRunner.run(InstinctRunner.java:
49)
    at com.intellij.rt.junit4.Junit4ClassSuite.run(Junit4ClassSuite.java:78)
    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 com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)


Original issue reported on code.google.com by [email protected] on 25 Nov 2007 at 10:21

Errors with no messages should get shown with no message

Summary should be something like:

The following errors ocurred while running the specification

Summary: 1 error occurred
1)  [This exception contained no message]


But is:

-spec:
     [java] AGeneSequence
     [java] - canBeConsedWithABaseToProduceANewSequence
     [java] AFastaParserWithoutAHeader
     [java] - turnsAnIteratorOfBytesIntoAnIteratorOfGeneSequences (FAILED)
     [java] 
     [java]     The following errors ocurred while running the specification
     [java]     
     [java]     Summary: 1 error occurred
     [java]     1)  
     [java]     
     [java]     Full details follow:
     [java]     
     [java]     1)  java.lang.RuntimeException: 
     [java]         at scala.Predef$.error(Predef.scala:76)
     [java]         at com.googlecode.furnace.parse.FastaParser$.parse(FastaParser.scala:11)
     [java]         at 
com.googlecode.furnace.parse.AFastaParserWithoutAHeader.turnsAnIteratorOfBytesIn
toAnIterato
rOfGeneSequences(AFastaParser.scala:15)
     [java]         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java]         at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     [java]         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:25)
     [java]         at java.lang.reflect.Method.invoke(Method.java:597)
     [java]         at 
com.googlecode.instinct.internal.edge.java.lang.reflect.MethodEdgeImpl.invoke(Me
thodEdgeImpl.
java:32)
     [java]         at 
com.googlecode.instinct.internal.util.MethodInvokerImpl.invokeMethod(MethodInvok
erImpl.java:
32)
     [java]         at 
com.googlecode.instinct.internal.util.MethodInvokerImpl.invokeMethod(MethodInvok
erImpl.java:
27)
     [java]         at 
com.googlecode.instinct.runner.StandardSpecificationLifecycle.runMethod(Standard
SpecificationL
ifecycle.java:143)
     [java]         at 
com.googlecode.instinct.runner.StandardSpecificationLifecycle.access$100(Standar
dSpecification
Lifecycle.java:46)
     [java]         at 
com.googlecode.instinct.runner.StandardSpecificationLifecycle$4.f(StandardSpecif
icationLifecycle
.java:98)
     [java]         at 
com.googlecode.instinct.runner.StandardSpecificationLifecycle$4.f(StandardSpecif
icationLifecycle
.java:95)
     [java]         at 
com.googlecode.instinct.internal.runner.SpecificationRunnerImpl.runSpecification
(SpecificationRu
nnerImpl.java:90)
     [java]         at 
com.googlecode.instinct.internal.runner.SpecificationRunnerImpl.runLifecycle(Spe
cificationRunne
rImpl.java:76)
     [java]         at 
com.googlecode.instinct.internal.runner.SpecificationRunnerImpl.run(Specificatio
nRunnerImpl.jav
a:62)
     [java]         at 
com.googlecode.instinct.internal.core.CompleteSpecificationMethod.run(CompleteSp
ecificationM
ethod.java:83)
     [java]         at 
com.googlecode.instinct.internal.runner.StandardContextRunner$1.e(StandardContex
tRunner.jav
a:62)
     [java]         at 
com.googlecode.instinct.internal.runner.StandardContextRunner$1.e(StandardContex
tRunner.jav
a:59)
     [java]         at fj.data.List.foreach(List.java:225)
     [java]         at 
com.googlecode.instinct.internal.runner.StandardContextRunner.runSpecifications(
StandardCont
extRunner.java:59)
     [java]         at 
com.googlecode.instinct.internal.runner.StandardContextRunner.runContextClass(St
andardConte
xtRunner.java:53)
     [java]         at 
com.googlecode.instinct.internal.runner.StandardContextRunner.run(StandardContex
tRunner.jav
a:46)
     [java]         at 
com.googlecode.instinct.internal.core.ContextClassImpl.run(ContextClassImpl.java
:58)
     [java]         at com.googlecode.instinct.runner.TextRunner.run(TextRunner.java:94)
     [java]         at com.googlecode.instinct.runner.TextRunner$1.e(TextRunner.java:106)
     [java]         at com.googlecode.instinct.runner.TextRunner$1.e(TextRunner.java:104)
     [java]         at fj.data.Array.foreach(Array.java:211)
     [java]         at 
com.googlecode.instinct.runner.TextRunner.runContexts(TextRunner.java:104)
     [java]         at 
com.googlecode.furnace.SpecificationRunner$.main(SpecificationRunner.scala:10)
     [java]         at com.googlecode.furnace.SpecificationRunner.main(SpecificationRunner.scala)
     [java]         at 
com.googlecode.instinct.internal.runner.SpecificationRunnerImpl.fail(Specificati
onRunnerImpl.jav
a:140)
     [java]         at 
com.googlecode.instinct.internal.runner.SpecificationRunnerImpl.runSpecification
(SpecificationRu
nnerImpl.java:95)
     [java]         at 
com.googlecode.instinct.internal.runner.SpecificationRunnerImpl.runLifecycle(Spe
cificationRunne
rImpl.java:76)
     [java]         at 
com.googlecode.instinct.internal.runner.SpecificationRunnerImpl.run(Specificatio
nRunnerImpl.jav
a:62)
     [java]         at 
com.googlecode.instinct.internal.core.CompleteSpecificationMethod.run(CompleteSp
ecificationM
ethod.java:83)
     [java]         at 
com.googlecode.instinct.internal.runner.StandardContextRunner$1.e(StandardContex
tRunner.jav
a:62)
     [java]         at 
com.googlecode.instinct.internal.runner.StandardContextRunner$1.e(StandardContex
tRunner.jav
a:59)
     [java]         at fj.data.List.foreach(List.java:225)
     [java]         at 
com.googlecode.instinct.internal.runner.StandardContextRunner.runSpecifications(
StandardCont
extRunner.java:59)
     [java]         at 
com.googlecode.instinct.internal.runner.StandardContextRunner.runContextClass(St
andardConte
xtRunner.java:53)
     [java]         at 
com.googlecode.instinct.internal.runner.StandardContextRunner.run(StandardContex
tRunner.jav
a:46)
     [java]         at 
com.googlecode.instinct.internal.core.ContextClassImpl.run(ContextClassImpl.java
:58)
     [java]         at com.googlecode.instinct.runner.TextRunner.run(TextRunner.java:94)
     [java]         at com.googlecode.instinct.runner.TextRunner$1.e(TextRunner.java:106)
     [java]         at com.googlecode.instinct.runner.TextRunner$1.e(TextRunner.java:104)
     [java]         at fj.data.Array.foreach(Array.java:211)
     [java]         at 
com.googlecode.instinct.runner.TextRunner.runContexts(TextRunner.java:104)
     [java]         at 
com.googlecode.furnace.SpecificationRunner$.main(SpecificationRunner.scala:10)
     [java]         at com.googlecode.furnace.SpecificationRunner.main(SpecificationRunner.scala)
     [java] AFastaParserWithAHeader
     [java] - turnsAnIteratorOfBytesIntoAnIteratorOfGeneSequences


Original issue reported on code.google.com by [email protected] on 15 Aug 2008 at 6:08

expect.that() error comparing null to String

What steps will reproduce the problem?
1. Compile attached code
2. Run with JUnit4 (note @RunWith annotation)
3. Notice Specification "shouldLeaveValueOnStackAfterPeep()" passes

What is the expected output? What do you see instead?
  I'd expect to get a failure for this specification/test since pop() is
always returning a null and that shouldn't be equal to a String.

What version of the product are you using? On what operating system?
Instinct 0.1.5  on Ubuntu Linux 7.10

Please provide any additional information below.
  I was running the attached code for StackBehavior within an Eclipse 3.4M3
environment on Linux with Java 1.5.0_14 when I noticed this.  Maybe I'm
missing something, but shouldn't the expect.that() in this function return
a failure?

Original issue reported on code.google.com by [email protected] on 15 Nov 2007 at 9:23

Attachments:

Instinct-core should either not have a mandatory requirement on fj or should list it as mandatory dependency in the pom

What steps will reproduce the problem?

Run this project:
import com.googlecode.instinct.integrate.junit4.InstinctRunner
import com.googlecode.instinct.marker.annotate.*
import org.junit.runner.RunWith

@Grab(group='com.googlecode.instinct', module='instinct-core', version='0.1.9')

@RunWith(InstinctRunner.class)
public final class AWinningGame {
    @Subject private game
    Dice winningDice

    @BeforeSpecification
    void setUp() {
        winningDice = new RiggedDice(6)
        game = new Game(d1: winningDice, d2: winningDice)
    }

    @Specification
    void mustWinWhenBothDiceReturnSix() {
        println d.play() == 'win'
    }
}

interface Dice { def roll() }

class RiggedDice implements Dice {
    def value
    def roll() {
        value
    }
}

class Game {
    def d1, d2
    def play() {
        def result = (d1.roll() == 6 & d2.roll() == 6)
        result ? "win" : "lose"
    }
}

What is the expected output?

Test passes.

What do you see instead?

JUnit 4 Runner, Tests: 1, Failures: 1, Time: 5
Test Failure: initializationError(AWinningGame)
java.lang.NoClassDefFoundError: fj/Effect

What version of the product are you using? On what operating system?

Instinct-core 0.1.9, Vista, Groovy 1.6.3 with JUnit 4.6, Java 1.6.0_13

Original issue reported on code.google.com by [email protected] on 18 May 2009 at 3:09

Eclipse Plugin: Annotation formatting

The current eclipse formatting does not allow us to format field based
annotations differently to method based annotations.  Therefore either the
annotations are all on the same line for everything or are lined wrapped
for everything.

It would be really nice to format the field annotations so they are on the
same line as the field declaration and the method based annotations be line
wrapped.

Original issue reported on code.google.com by [email protected] on 19 Dec 2007 at 2:50

Allow specification specific before and after methods

Add before spec & after spec methods that are tied only to a particular
specification. This would allow specification specific cleanup. Consider
whether this or creating a new context for the spec(s) is more appropriate.
The context of this request is cleanup activities, that don't need to be
within the body of the spec.

See the RSpec example:

before(:each) do
 p "hello"
end

before(:mySpecMethod) do
  p "hello"
end

Original issue reported on code.google.com by [email protected] on 23 Oct 2007 at 4:58

find specifications in nested inner classes

I've had a few situations where I've wanted to group specifications in a
context together, but haven't felt that it needed to be broken into a
separate class. I think this could be handled by allowing specification
methods in (non-static?) inner classes  

eg.

public class ThingContext {
  inner class WithAFoo {
     public void shouldHaveThisSpecBeRun() {
     }
  }

  inner class WithABar {
     public void shouldPerhapsHaveDifferentExpectations() {
     }
  }
}

Some issues I've thought about:

* Before/After methods - what order should these be run in? Outside in
makes sense to me conceptually
* static/non-static classes - I think both should be supported. static
inner classes enforce that before methods from the inner class itself were run?


Original issue reported on code.google.com by [email protected] on 5 Dec 2007 at 12:30

Overriden specifications run twice

What steps will reproduce the problem?
1. Create a base class. Add a specification.
2. Through a subclass override the specification.
3. Run the subclass context. The subclass spec is run twice.

What is the expected output? What do you see instead?

The subclass spec should be run once.


Original issue reported on code.google.com by [email protected] on 5 Dec 2007 at 12:18

Attachments:

Instinct FirstStep results in "class file for fj.data.Either not found"

What steps will reproduce the problem?
1. create new project with maven2
2. include instinct repo and dependency, ie:

    <repositories>
        <repository>
            <id>instinct-repository</id>
            <url>http://instinct.googlecode.com/svn/artifacts/maven/</url>
        </repository>
    </repositories>
    <dependencies>
        <dependency>
            <groupId>com.googlecode.instinct</groupId>
            <artifactId>instinct-core</artifactId>
            <version>0.1.9</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

3. Write behaviour spec HelloWorld.trueMustBeTrue as:

expect.that(true).isTrue();


What is the expected output? What do you see instead?
Expected output is success. Actual output is:

class file for fj.data.Either not found
        expect.that(true).isTrue();


What version of the product are you using? On what operating system?

Instinct 0.1.9 from instinct maven repo.
Sun Java 1.6.0_10
Ubuntu Hardy Heron
Error seen in terminal & IntelliJ IDEA 

Original issue reported on code.google.com by [email protected] on 21 Aug 2008 at 10:35

JUnit 3 integration fails to link tests to source files

When a instinct JUnit 3 suite runs and the results are show in say an IDE
results window, double clicking on the test (specification) do not take you
to the Specification source method but rather to the SpecificationTestCase
class.  This is of course because our SpecificationMethods are wrapped
inside a SpecificationTestCase and the IDE (or JUnit) believes the
SpecificationTestCase holds the actual test methods.

The JUnit 4 integration works fine however, because (it has a much better
architecture!) it has a Description class of which we with the declaring
context class.

Original issue reported on code.google.com by [email protected] on 10 Aug 2007 at 3:01

The failure property does not get set on failure, so failing builds pass

What steps will reproduce the problem?
1. Create an ant build where the specification suite fails and a
failureproperty attribute is defined
2. Follow the instinct task with a failure task looking to the property in
step 1.
3. Execute the ant build.

What is the expected output? What do you see instead?
The build status should be failure. Instead, it is successful.

Original issue reported on code.google.com by [email protected] on 19 Nov 2008 at 10:11

Add 'should' syntax

What is the expected output? What do you see instead?

Instead of:

expect.that(value).equalTo(expected);

Some suggestions:

expect.that(value).shouldBeEqualTo(expected);
expect.that(value).shouldNotBeEqualTo(expected)



Original issue reported on code.google.com by [email protected] on 4 Oct 2007 at 4:40

Eclipse Plugin: Highlight the Actors differently

It is often hard to quickly determine which variables are the subjects,
mocks, dummies or stubs without having to look at the top of the Context to
find out how they are declared.  Having them coloured differently would get
instant semantic context.

Go forth and colour.

Original issue reported on code.google.com by [email protected] on 19 Dec 2007 at 2:43

Expected exception try-catch should only wrap specs, not before and after

If a before or after spec method throws an exception, it will get checked 
against the expected 
exception. This should not happen.

The following class will pass, but should fail, as the after spec throws an 
exception, and the 
expected exception from the spec method is never thrown.

class Foo {
    void after() {
        throw new RuntimeException();
    }

    @Specification(expected = RuntimeException.class)
    void spec() {
    }
}

Original issue reported on code.google.com by [email protected] on 4 Dec 2007 at 6:04

InstinctTask requires specification classes to be present in taskdef classpath

What steps will reproduce the problem?
1. Create an ant build where the instinct task is taskdef(ined) prior to
the specification classes being compiled.
2. Execute the ant target

What is the expected output? What do you see instead?
Expected: All specifications run, as the task should use the nested
classpath provided, and not the classpath used for the taskdef
Actual: The specifications are not found and nothing is executed.


Original issue reported on code.google.com by [email protected] on 19 Nov 2008 at 10:07

Add 'should

What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?


What version of the product are you using? On what operating system?


Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 4 Oct 2007 at 4:34

Subcontext Support

It would be nice to have support for subcontexts within contexts.

Say we wanted to spec out reading a single line from a file across
alphabetic, special characters and numbers. Currently we would get the
following contexts:

FileReaderWithSingleLineFileReadingAlphabeticCharacters
 - spec1
 - spec2
FileReaderWithSingleLineFileReadingSpecialCharacters
 - spec1
 - spec2
FileReaderWithSingleLineFileReadingNumbers
 - spec1
 - spec2


It might be useful to replace it with:

FileReaderWithSingleLineFile
 - ReadingAlphabeticCharacters
   - spec1
   - spec2
 - ReadingSpecialCharacters
   - spec1
   - spec2
 - ReadingSpecialNumbers
   - spec1
   - spec2

Original issue reported on code.google.com by [email protected] on 13 Feb 2008 at 2:45

Support scala.List expect

Provide support for scala.List:

val sequences = parse(sequence, 10).toList
expect.that(sequences) isOfSize 8


Original issue reported on code.google.com by [email protected] on 15 Aug 2008 at 6:17

Context treeview shows baseclass and subclass when only subclass is run

What steps will reproduce the problem?
1. Create class. Add a specification method.
2. Extends a subclass from the above base class. Add a specification method.
3. Run the subclass. The treeview on the bottom left shows 2 Contexts being
run (the base and subclass) although you ran only one (the subclass). 

What is the expected output? What do you see instead?

Expected: to see the subclass in the treeview with specifications from the
baseclass and itself. 

Saw instead: The treeview with the baseclass and subclass with
specifications in each class.

Please use labels and text to provide additional information.

See attached screenshot and attached files. 

Original issue reported on code.google.com by [email protected] on 4 Dec 2007 at 6:14

Attachments:

Formatting of multiple exception report could be nicer

When running a spec in intelliJ that spits out multiple errors (mock
exceptions and some runtime errors perhaps), there's a lot of noise between
the error reports.

Perhaps style them something like this:

com.googlecode.instinct.internal.util.AggregatingException: The following
errors ocurred while running the specification; 2 error(s) occurred

1) first message
2) second message

Full details:
full stack trace and message as it is now

Original issue reported on code.google.com by [email protected] on 6 Aug 2008 at 4:45

Wrap obscure jMock exceptions

This was caused when more than one expectation was made on the mock, even
though the first individual call was correct.


java.lang.IllegalArgumentException: not all parameters were given explicit
constraints: either all parameters must be specified by explicit
constraints or all must be specified by literal values to match
    at
org.jmock.internal.InvocationExpectationBuilder.checkParameterMatcherCount(Invoc
ationExpectationBuilder.java:92)
    at
org.jmock.internal.InvocationExpectationBuilder.createExpectationFrom(Invocation
ExpectationBuilder.java:83)
    at org.jmock.Mockery.dispatch(Mockery.java:186)
    at org.jmock.Mockery.access$000(Mockery.java:34)
    at org.jmock.Mockery$MockObject.invoke(Mockery.java:236)
    at org.jmock.internal.InvocationDiverter.invoke(InvocationDiverter.java:27)
    at
org.jmock.internal.ProxiedObjectIdentity.invoke(ProxiedObjectIdentity.java:36)
    at org.jmock.lib.legacy.ClassImposteriser$4.invoke(ClassImposteriser.java:113)
    at
com.googlecode.instinct.internal.util.ObjectFactory$$EnhancerByCGLIB$$2cdec54f.c
reate(<generated>)
    at
com.googlecode.instinct.internal.locate.ContextFinderImplAtomicTest$2.expectClas
sFileFilterCreated(ContextFinderImplAtomicTest.java:90)
    at
com.googlecode.instinct.internal.locate.ContextFinderImplAtomicTest$2.<init>(Con
textFinderImplAtomicTest.java:82)
    at
com.googlecode.instinct.internal.locate.ContextFinderImplAtomicTest.testGetConte
xtNames(ContextFinderImplAtomicTest.java:78)
    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
com.googlecode.instinct.test.InstinctTestCase.runBare(InstinctTestCase.java:38)
    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 com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)


Original issue reported on code.google.com by [email protected] on 16 Nov 2007 at 5:37

Failure detail in spec report is not XML encoded

What steps will reproduce the problem?
1. Write a failing specification where the error message would contain
special XML characters. E.G. expect.that(true).isEqualTo(false);
2. Run the instinct task
3. Run the instinct-report task
4. View the report.

What is the expected output? What do you see instead?
The report should contain:
Expected: <true>
     got: <false>
Instead it renders this as
Expected:
     got:
because the XML characters are not escaped.

Original issue reported on code.google.com by [email protected] on 19 Nov 2008 at 11:05

Eclipse Plugin: Context creator

It would be awesome to have a wizard or something that automatically
created a context AND the subject's interface AND implementation.

This would save heaps of time.

Original issue reported on code.google.com by [email protected] on 19 Dec 2007 at 2:52

@BeforeSpecification does not run if implemented in an abstract base class.

What steps will reproduce the problem?
1.  Create an abstract base class with a @BeforeSpecification method.
2. Extend the abstract base class from a context which has a @Specification
3. Run the specification. Now the @BeforeSpecification method is never invoked 
and any code you 
have in that block fails to run and makes the specification fail.

What is the expected output? What do you see instead?
Depends on what the @BeforeSpecification method is supposed to construct/do.


Please use labels and text to provide additional information.


Original issue reported on code.google.com by [email protected] on 3 Oct 2007 at 4:25

Brief results formatter is printing duplicates

What steps will reproduce the problem?
1. Execute specifications with the BriefResultMessageFormatter attached

What is the expected output? What do you see instead?
Expected: compact results once only.
Actual: sparse results followed by the expected compact results.

Original issue reported on code.google.com by [email protected] on 19 Nov 2008 at 10:18

Instinct assertion failures translates to JUnit errors and not JUnit failures (JUnit 4)

Currently in the JUnit 4 integration implementation when specification
runner finds an assertion failure it is reported in JUnit as a test error.
 This is incorrect, it should be reported as a test failure.

Failures are checked for and errors are unanticipated.

It seems that the Instinct SpecificationResult API makes no distinction to
between a test failing and a test erroring.  It only has a method named
completedSuccessfully() which returns a boolean.

It may be an option to check to see what exception is returned and if it is
an AssertionException then flag the test as failed and not as errorred. 
But I think that may be looking too deeply into the Instinct implementation
and it may be better to redesign the interface.  Tom? 


Original issue reported on code.google.com by [email protected] on 10 Aug 2007 at 5:33

It would be nice not to have to depend on jmock when writing a BDD-style test involving no mocks

What steps will reproduce the problem?

1. Write a BDD-flavoured test involving no mocks, e.g. the storer example from:
http://docs.codehaus.org/display/GROOVY/Using+Instinct+with+Groovy

2. Run the spec

What is the expected output? What do you see instead?

Would like this:

- should_reverse_lists (FAILED)
    java.lang.AssertionError: Expression: (reversed == expectedReverse).
Values: reversed = [5, 3, 1], expectedReverse = [5, 3, 2]

Intead, see this:

Caught: java.lang.NoClassDefFoundError: org/jmock/api/ExpectationError

What version of the product are you using? On what operating system?

0.1.5

Original issue reported on code.google.com by [email protected] on 20 Oct 2007 at 9:19

CommandLineRunnerSlowTest.testRunsContextAndReportsErrors fails to finish under Windows

The testRunContextAndReportsErrors() test fails to finish under Windows XP
both in IDEA and from the command line.  The test just 'hangs' when it is run.

I have not tested this under Vista.

Consequently running the AllTestSuite fails to finish, which is a bit
annoying as I can't see if my changes have broke that part of the build.

Have you guys (Tom, Sanjiv) got a Windows box in the office?

Original issue reported on code.google.com by [email protected] on 5 Dec 2007 at 6:16

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.