Comments (2)
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 [email protected]
on 18 May 2009 at 3:29
from instinct.
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 [email protected]
on 20 Oct 2009 at 10:06
from instinct.
Related Issues (20)
- CollectionChecker.hasTheSameContentAs() is broken HOT 1
- containsItems method for arrays HOT 1
- Subcontext Support HOT 1
- Abstract classes are being run as a result of specification runner refactoring HOT 1
- Expected exceptions are being printed to console in Ant runner even though spec passes HOT 1
- Functional java jar is not included in release zip HOT 1
- Add more matchers for FJ data types HOT 1
- Formatting of multiple exception report could be nicer HOT 1
- Errors with no messages should get shown with no message HOT 1
- Support scala.List expect HOT 1
- Support size operators in place of isEqualTo, isGreateThan, etc. HOT 1
- Instinct FirstStep results in "class file for fj.data.Either not found" HOT 2
- Example project pom.xml isn't correct. HOT 1
- InstinctTask requires specification classes to be present in taskdef classpath HOT 2
- The failure property does not get set on failure, so failing builds pass HOT 2
- Brief results formatter is printing duplicates HOT 1
- Failure detail in spec report is not XML encoded HOT 2
- AssertException.assertThrows false positive
- Testing spring-based applications HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from instinct.