summaryrefslogtreecommitdiffstats
path: root/spec/fln_bot_rules_spec.rb
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2023-11-08 15:20:24 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2023-11-08 15:20:24 +0100
commit0c8b3c3000b565af71961dbf5cbb058ccfe9fd04 (patch)
treee11790d18fd2d89704104766ef777e09ee02962d /spec/fln_bot_rules_spec.rb
parent45df0be14323eaaa140f56b930f3d56d8239a902 (diff)
downloadcolonial-twilight-0c8b3c3000b565af71961dbf5cbb058ccfe9fd04.zip
colonial-twilight-0c8b3c3000b565af71961dbf5cbb058ccfe9fd04.tar.gz
FLNBotRules : support rally 9 and specs
Diffstat (limited to 'spec/fln_bot_rules_spec.rb')
-rw-r--r--spec/fln_bot_rules_spec.rb42
1 files changed, 42 insertions, 0 deletions
diff --git a/spec/fln_bot_rules_spec.rb b/spec/fln_bot_rules_spec.rb
index 9e200f4..1e2fc27 100644
--- a/spec/fln_bot_rules_spec.rb
+++ b/spec/fln_bot_rules_spec.rb
@@ -411,6 +411,48 @@ describe ColonialTwilight::FLNBotRules do
c = Sector.new(fln_active: 1, fln_underground: 1, gov_cubes: 1)
expect(@rules.rally_8_priority([a, b, c])[0]).to be b
end
+
+ it 'may_rally_9_in? no control and no base' do
+ a = Sector.new(terror: 2)
+ expect(@rules.may_rally_9_in?(a)).to be false
+ end
+
+ it 'may_rally_9_in? has control but no terror and oppose' do
+ a = Sector.new(fln_active: 1, oppose: true)
+ expect(@rules.may_rally_9_in?(a)).to be false
+ end
+
+ it 'may_rally_9_in? has base but no terror and oppose' do
+ a = Sector.new(fln_bases: 1, gov_cubes: 1, oppose: true)
+ expect(@rules.may_rally_9_in?(a)).to be false
+ end
+
+ it 'may_rally_9_in? has control and terror' do
+ a = Sector.new(fln_active: 1, terror: 1)
+ expect(@rules.may_rally_9_in?(a)).to be true
+ end
+
+ it 'may_rally_9_in? has base and terror' do
+ a = Sector.new(fln_bases: 1, gov_cubes: 1, terror: 1)
+ expect(@rules.may_rally_9_in?(a)).to be true
+ end
+
+ it 'may_rally_9_in? has control and not oppose' do
+ a = Sector.new(fln_active: 1, terror: 1)
+ expect(@rules.may_rally_9_in?(a)).to be true
+ end
+
+ it 'may_rally_9_in? has base and not oppose' do
+ a = Sector.new(fln_bases: 1, gov_cubes: 1, terror: 1)
+ expect(@rules.may_rally_9_in?(a)).to be true
+ end
+
+ it 'rally_9_priority no cubes' do
+ a = Sector.new(terror: 1, oppose: true)
+ b = Sector.new(terror: 1, neutral: true)
+ c = Sector.new(terror: 2, neutral: true)
+ expect(@rules.rally_9_priority([a, b, c], 2)[0]).to be b
+ end
end
describe 'Extort' do