Permalink
Browse files

test result appending

  • Loading branch information...
1 parent a221c28 commit 50b52d125c43136a54542e7deea2f58fc10426d8 @rjbs committed Dec 7, 2012
Showing with 28 additions and 0 deletions.
  1. +6 −0 eg/monster/roboelf
  2. +22 −0 t/redir.t
View
@@ -14,3 +14,9 @@ xp-bonuses:
- Pointy ears
- Metal skin
description: Built by OCP to replace traditional elfs.
+extras:
+ - label: Monolith?
+ dice: 1d10
+ results:
+ 1-9: ~
+ 10: { append: Monolith }
View
@@ -64,6 +64,7 @@ test_result("elfs (shiny kind)" => {
4, # number appearing (elfs)
1, # robots? HECK YES!
1, # number appearing (roboelfs)
+ 6, # no monolith
20, # hit points
],
test => sub {
@@ -77,4 +78,25 @@ test_result("elfs (shiny kind)" => {
},
});
+test_result("elfs (shiny kind (with big stone))" => {
+ file => 'eg/monster/elf',
+ rolls => [
+ 4, # number appearing (elfs)
+ 1, # robots? HECK YES!
+ 1, # number appearing (roboelfs)
+ 10, # monolith!
+ 20, # hit points
+ ],
+ test => sub {
+ my @results = flatten_multi($_[0]);
+ is(@results, 2, "we got a two-part encounter");
+
+ my @roboelfs = $results[0]->units;
+ is(@roboelfs, 1, "...one unit, too");
+ is($roboelfs[0]{hp}, 20, "... with 20 hp");
+
+ simple_ok($results[1], 'Monolith', 'second result')
+ },
+});
+
done_testing;

0 comments on commit 50b52d1

Please sign in to comment.