diff options
author | Jesse Luehrs <doy@tozt.net> | 2014-05-25 10:45:06 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2014-05-25 10:45:06 -0400 |
commit | a4e8c201077e389e71b4a0fa9a63ffe666481c42 (patch) | |
tree | ab17a553757bb2570575741152db2ab218a983e5 /t | |
parent | 26bba9f137ac161c9c394c74332968fd91d7acfc (diff) | |
download | games-smtnocturne-demons-a4e8c201077e389e71b4a0fa9a63ffe666481c42.tar.gz games-smtnocturne-demons-a4e8c201077e389e71b4a0fa9a63ffe666481c42.zip |
don't allow fusing bosses that haven't been beaten yet
Diffstat (limited to 't')
-rw-r--r-- | t/basic.t | 2 | ||||
-rw-r--r-- | t/lib/Test/Games/SMTNocturne/Demons.pm | 12 |
2 files changed, 12 insertions, 2 deletions
@@ -6,6 +6,8 @@ use lib 't/lib'; use Test::Games::SMTNocturne::Demons; +set_fusion_options({ bosses => ['Forneus', 'Troll'] }); + fusion_is('Uzume', 'Uzume', undef); fusion_is('Uzume', 'Jack Frost', 'Forneus'); fusion_is('Uzume', 'Mou-Ryo', undef); diff --git a/t/lib/Test/Games/SMTNocturne/Demons.pm b/t/lib/Test/Games/SMTNocturne/Demons.pm index 5ccd8ac..92ad93c 100644 --- a/t/lib/Test/Games/SMTNocturne/Demons.pm +++ b/t/lib/Test/Games/SMTNocturne/Demons.pm @@ -6,13 +6,21 @@ use Exporter 'import'; use Games::SMTNocturne::Demons; use Test::More; -our @EXPORT = ('fusion_is'); +our @EXPORT = ('fusion_is', 'set_fusion_options'); + +my $FUSION_OPTIONS = {}; + +sub set_fusion_options { + $FUSION_OPTIONS = $_[0]; +} sub fusion_is { local $Test::Builder::Level = $Test::Builder::Level + 1; my ($demon1, $demon2, $expected) = @_; - my $fused = eval { Games::SMTNocturne::Demons::fuse($demon1, $demon2) }; + my $fused = eval { + Games::SMTNocturne::Demons::fuse($demon1, $demon2, $FUSION_OPTIONS) + }; die $@ if $@ && $@ !~ /\bnyi\b/; local $TODO = $@ if $@; |