summaryrefslogtreecommitdiffstats
path: root/spec/fln_rules_spec.rb
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2024-05-02 17:18:53 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2024-05-02 17:18:53 +0200
commitb02a37e7878a3316d34fbc0d4f3bd74284c44b28 (patch)
treeea95b8e41157b41caedad8a8d538cbcd10cebb9e /spec/fln_rules_spec.rb
parentafa0b16ba4ed371092071e635a0fdd688d8efb9c (diff)
downloadcolonial-twilight-master.zip
colonial-twilight-master.tar.gz
FLNRules : add March rules and specsHEADmaster
Diffstat (limited to 'spec/fln_rules_spec.rb')
-rw-r--r--spec/fln_rules_spec.rb38
1 files changed, 38 insertions, 0 deletions
diff --git a/spec/fln_rules_spec.rb b/spec/fln_rules_spec.rb
index 6a39759..7dfc00b 100644
--- a/spec/fln_rules_spec.rb
+++ b/spec/fln_rules_spec.rb
@@ -158,4 +158,42 @@ describe ColonialTwilight::FLNRules do
expect(rules.oas_spaces(@board).size).to eq(14)
end
end
+
+ describe 'March' do
+ it 'may keep on' do
+ expect(rules.must_stop?(@board.by_name('Saida'), @board.by_name('Mecheria'))).to be false
+ end
+
+ it 'must stop when crossing international borders' do
+ expect(rules.must_stop?(@board.by_name('Morocco'), @board.by_name('Mecheria'))).to be true
+ end
+
+ it 'must stop when crossing international borders' do
+ expect(rules.must_stop?(@board.by_name('Tebessa'), @board.by_name('Tunisia'))).to be true
+ end
+
+ it 'must stop when crossing a wilaya border' do
+ expect(rules.must_stop?(@board.by_name('Setif'), @board.by_name('Barika'))).to be true
+ end
+
+ it 'must not activate' do
+ expect(rules.must_activate?(@board, @board.by_name('Setif'), @board.by_name('Barika'))).to be false
+ end
+
+ it 'might activate when support' do
+ c = @board.by_name('Constantine')
+ c.alignment = :support
+ c.add :french_troops, 1
+ expect(rules.must_activate?(@board, @board.by_name('Setif'), c, 2)).to be false
+ expect(rules.must_activate?(@board, @board.by_name('Setif'), c, 3)).to be true
+ end
+
+ it 'might activate when crossing border' do
+ c = @board.by_name('Mecheria')
+ c.add :french_troops, 1
+ expect(rules.must_activate?(@board, @board.by_name('Morocco'), c, 2)).to be false
+ expect(rules.must_activate?(@board, @board.by_name('Morocco'), c, 3)).to be true
+ end
+
+ end
end