summaryrefslogtreecommitdiffstats
path: root/spec/fln_rules_spec.rb
diff options
context:
space:
mode:
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