Synesso / instinct

Automatically exported from code.google.com/p/instinct
0 stars 0 forks source link

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

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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 Paul.Kin...@gmail.com on 18 May 2009 at 3:09

GoogleCodeExporter commented 9 years ago
This works but fj dependency should not be visible at this level:

import com.googlecode.instinct.integrate.junit4.InstinctRunner
import com.googlecode.instinct.marker.annotate.*
import org.junit.runner.RunWith

@Grapes([
    @Grab(group='com.googlecode.instinct', module='instinct-core', version='0.1.9'),
    @Grab(group='org.functionaljava', module='fj', version='2.19')
])
@RunWith(InstinctRunner.class)
public final class AWinningGame {
    @Subject private game
    Dice winningDice

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

    @Specification
    void mustWinWhenBothDiceReturnSix() {
        println game.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"
    }
}

Original comment by Paul.Kin...@gmail.com on 18 May 2009 at 3:29

GoogleCodeExporter commented 9 years ago
instinct-core 0.1.9 did not declare it's dependency on FJ.
instinct-core 0.2.0 does, but the repository is no longer valid.

Original comment by jem.maw...@gmail.com on 20 Oct 2009 at 10:06