Hi all,
I've run into a little problem with one of my stories; text below.
The outcome "the glyph segments should become junk" appears in two stories, but in one of them another glyph has already been dropped - so the Junk will differ between them. Implementation (for the first scenario only) also below.
I'd welcome suggestions as to how to resolve this. My current idea is to add a context to the World, so that we can find out which Scenario we're running in and act accordingly.
What do you think?
Liz.
PS: I hope you don't mind that I'm continuing with the game development. When I stop finding new things that I need to have in the framework, I'll stop writing games; until then I assume that anything find that I need is something that our users might need too.
--
Story: the player drops the glyph
As a game player
I want to drop the glyph
So that I can save time
Scenario: the player drops the glyph into an empty pit
Given the first glyph is displayed on the board
When the player presses the drop key
Then the glyph should fall to the bottom
When time passes
Then the glyph segments should become junk
and the next glyph should appear
Scenario: the player drops the glyph onto junk
Given the player drops the glyph into an empty pit
When the player presses the drop key
Then the glyph should fall onto the junk
and the glyph segments should become junk
and the next glyph should appear
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email
I've run into a little problem with one of my stories; text below.
The outcome "the glyph segments should become junk" appears in two stories, but in one of them another glyph has already been dropped - so the Junk will differ between them. Implementation (for the first scenario only) also below.
I'd welcome suggestions as to how to resolve this. My current idea is to add a context to the World, so that we can find out which Scenario we're running in and act accordingly.
What do you think?
Liz.
PS: I hope you don't mind that I'm continuing with the game development. When I stop finding new things that I need to have in the framework, I'll stop writing games; until then I assume that anything find that I need is something that our users might need too.
--
Story: the player drops the glyph
As a game player
I want to drop the glyph
So that I can save time
Scenario: the player drops the glyph into an empty pit
Given the first glyph is displayed on the board
When the player presses the drop key
Then the glyph should fall to the bottom
When time passes
Then the glyph segments should become junk
and the next glyph should appear
Scenario: the player drops the glyph onto junk
Given the player drops the glyph into an empty pit
When the player presses the drop key
Then the glyph should fall onto the junk
and the glyph segments should become junk
and the next glyph should appear
--
public class TheGlyphSegmentsShouldBecomeJunk extends HellboundOutcome {
private Segments expectedSegments;
private Color expectedColor;
public void setExpectationIn(World world) {
expectedSegments = new Segments(
new Segment(2, 11),
new Segment(3, 11),
new Segment(4, 11),
new Segment(3, 12)
);
expectedColor = Hellbound.COLORMAP.getColorFor(GlyphType.JUNK);
}
public void verifyAnyTimeIn(World world) {
RenderedPit pit = getPit(world);
Ensure.that(pit, contains(expectedSegments, expectedColor));
}
}
--
Elizabeth Keogh
[EMAIL PROTECTED]
http://www.livejournal.com/users/sirenian
public class TheGlyphSegmentsShouldBecomeJunk extends HellboundOutcome {
private Segments expectedSegments;
private Color expectedColor;
public void setExpectationIn(World world) {
expectedSegments = new Segments(
new Segment(2, 11),
new Segment(3, 11),
new Segment(4, 11),
new Segment(3, 12)
);
expectedColor = Hellbound.COLORMAP.getColorFor(GlyphType.JUNK);
}
public void verifyAnyTimeIn(World world) {
RenderedPit pit = getPit(world);
Ensure.that(pit, contains(expectedSegments, expectedColor));
}
}
--
Elizabeth Keogh
[EMAIL PROTECTED]
http://www.livejournal.com/users/sirenian
