diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2023-11-09 15:33:11 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2023-11-09 15:33:11 +0100 |
commit | 073dca3a5d42204952eeeb0fcbefa753466efc2e (patch) | |
tree | 6981d41b7b95d3e41e297b7174bb3dc59e442685 /spec | |
parent | 7c0cd9e0cb6251b78793f92a41f7377988d3e5df (diff) | |
download | colonial-twilight-073dca3a5d42204952eeeb0fcbefa753466efc2e.zip colonial-twilight-073dca3a5d42204952eeeb0fcbefa753466efc2e.tar.gz |
FLNBotRules : support Subvert
Diffstat (limited to 'spec')
-rw-r--r-- | spec/fln_bot_rules_spec.rb | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/spec/fln_bot_rules_spec.rb b/spec/fln_bot_rules_spec.rb index 1e2fc27..328b316 100644 --- a/spec/fln_bot_rules_spec.rb +++ b/spec/fln_bot_rules_spec.rb @@ -513,6 +513,40 @@ describe ColonialTwilight::FLNBotRules do end end + describe 'Subvert' do + it 'may_subvert_1_in?' do + a = Sector.new + expect(@rules.may_subvert_1_in?(a, 2)).to be false + end + + it 'may_subvert_1_in?' do + a = Sector.new(fln_underground: 1, algerian_police: 1) + expect(@rules.may_subvert_1_in?(a, 2)).to be true + end + + it 'may_subvert_1_in?' do + a = Sector.new(fln_underground: 1, algerian_police: 3) + expect(@rules.may_subvert_1_in?(a, 2)).to be false + end + + it 'subvert_1_priority algerian police' do + a = Sector.new(fln_underground: 1, algerian_police: 1) + b = Sector.new(fln_underground: 1, algerian_police: 3) + c = Sector.new(fln_underground: 1, algerian_police: 2) + expect(@rules.subvert_1_priority([a, b, c])[0]).to be b + end + + it 'may_subvert_2_in?' do + a = Sector.new(fln_underground: 1) + expect(@rules.may_subvert_2_in?(a)).to be false + end + + it 'may_subvert_2_in?' do + a = Sector.new(fln_underground: 1, algerian_police: 1) + expect(@rules.may_subvert_2_in?(a)).to be true + end + end + describe '8.1.2 Procedure Guidelines' do it 'available_fln_bases?' do @board.available_fln_bases = 0 |